wiki:Docs/Prog/Manual/ApplicationLibraries/lib825ev/File/GetFilesInPathWithExtension

GetFilesInPathWithExtension

Search for files in a directory having the specified extension

int GetFilesInPathWithExtension(const char* path, const char* ext, vector<string>& result);

Parameters

path = The path to search ext = The extension to search for

Return Value

This function returns the number of files found

Remarks

Examples

vector<string> pdfList;
int pdfFileCnt = GetFilesInPathWithExtension(appDataPath.c_str(), "PDF", pdfList);
if(pdfFileCnt > 0) {
  int n;
  for(auto fileName : pdfList) {
    printf("pdf file [%s]\n", fileName.c_str());
  }
}

See Also

Last modified 6 months ago Last modified on 05/17/24 13:12:47
Note: See TracWiki for help on using the wiki.