{"id":4042,"date":"2014-03-30T07:20:50","date_gmt":"2014-03-30T07:20:50","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/save-all-file-names-in-a-directory-to-a-vector-collection-of-common-programming-errors\/"},"modified":"2014-03-30T07:20:50","modified_gmt":"2014-03-30T07:20:50","slug":"save-all-file-names-in-a-directory-to-a-vector-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/save-all-file-names-in-a-directory-to-a-vector-collection-of-common-programming-errors\/","title":{"rendered":"Save all file names in a directory to a vector-Collection of common programming errors"},"content":{"rendered":"<p>Something like this (Note, Format is a sprintf:ish funciton you can replace)<\/p>\n<pre><code>bool MakeFileList(const wchar_t* pDirectory,vector *pFileList)\n{\n    wstring sTemp = Format(L\"%s\\\\*.%s\",pDirectory,L\"xml\");\n\n    _wfinddata_t first_file;\n\n    long hFile = _wfindfirst(sTemp.c_str(),&amp;first_file);\n\n    if(hFile != -1)\n    {\n        wstring sFile = first_file.name;\n        wstring sPath = Format(L\"%s%s\",pDirectory,sFile.c_str());\n        pFileList-&gt;push_back(sPath);\n\n        while(_wfindnext(hFile,&amp;first_file) != -1)\n        {\n            wstring sFile = first_file.name;\n            wstring sPath = Format(L\"%s%s\",pDirectory,sFile.c_str());\n            pFileList-&gt;push_back(sPath);\n        }\n        _findclose(hFile);\n    }else\n        return false;\n\n    return true;    \n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Something like this (Note, Format is a sprintf:ish funciton you can replace) bool MakeFileList(const wchar_t* pDirectory,vector *pFileList) { wstring sTemp = Format(L&#8221;%s\\\\*.%s&#8221;,pDirectory,L&#8221;xml&#8221;); _wfinddata_t first_file; long hFile = _wfindfirst(sTemp.c_str(),&amp;first_file); if(hFile != -1) { wstring sFile = first_file.name; wstring sPath = Format(L&#8221;%s%s&#8221;,pDirectory,sFile.c_str()); pFileList-&gt;push_back(sPath); while(_wfindnext(hFile,&amp;first_file) != -1) { wstring sFile = first_file.name; wstring sPath = Format(L&#8221;%s%s&#8221;,pDirectory,sFile.c_str()); pFileList-&gt;push_back(sPath); } [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4042","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4042","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4042"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4042\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4042"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}