| | 1 | = GetFilesInPathWithExtension = |
| | 2 | Search for files in a directory having the specified extension |
| | 3 | |
| | 4 | {{{ |
| | 5 | int GetFilesInPathWithExtension(const char* path, const char* ext, vector<string>& result); |
| | 6 | }}} |
| | 7 | |
| | 8 | == Parameters == |
| | 9 | |
| | 10 | path = The path to search |
| | 11 | ext = The extension to search for |
| | 12 | |
| | 13 | == Return Value == |
| | 14 | |
| | 15 | This function returns the number of files found |
| | 16 | |
| | 17 | == Remarks == |
| | 18 | |
| | 19 | |
| | 20 | == Examples == |
| | 21 | |
| | 22 | {{{ |
| | 23 | vector<string> pdfList; |
| | 24 | int pdfFileCnt = GetFilesInPathWithExtension(appDataPath.c_str(), "PDF", pdfList); |
| | 25 | if(pdfFileCnt > 0) { |
| | 26 | int n; |
| | 27 | for(auto fileName : pdfList) { |
| | 28 | printf("pdf file [%s]\n", fileName.c_str()); |
| | 29 | } |
| | 30 | } |
| | 31 | |
| | 32 | |
| | 33 | |
| | 34 | }}} |
| | 35 | |
| | 36 | |
| | 37 | == See Also == |
| | 38 | |
| | 39 | |
| | 40 | |