Warning: Cannot modify header information - headers already sent by (output started at /home/fantasmo/public_html/ash.wine/wp-content/plugins/jetpack/jetpack.php:1) in /home/fantasmo/public_html/ash.wine/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/fantasmo/public_html/ash.wine/wp-content/plugins/jetpack/jetpack.php:1) in /home/fantasmo/public_html/ash.wine/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/fantasmo/public_html/ash.wine/wp-content/plugins/jetpack/jetpack.php:1) in /home/fantasmo/public_html/ash.wine/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/fantasmo/public_html/ash.wine/wp-content/plugins/jetpack/jetpack.php:1) in /home/fantasmo/public_html/ash.wine/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/fantasmo/public_html/ash.wine/wp-content/plugins/jetpack/jetpack.php:1) in /home/fantasmo/public_html/ash.wine/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/fantasmo/public_html/ash.wine/wp-content/plugins/jetpack/jetpack.php:1) in /home/fantasmo/public_html/ash.wine/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/fantasmo/public_html/ash.wine/wp-content/plugins/jetpack/jetpack.php:1) in /home/fantasmo/public_html/ash.wine/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/fantasmo/public_html/ash.wine/wp-content/plugins/jetpack/jetpack.php:1) in /home/fantasmo/public_html/ash.wine/wp-includes/rest-api/class-wp-rest-server.php on line 1775
{"id":290,"date":"2016-04-26T01:33:00","date_gmt":"2016-04-25T20:03:00","guid":{"rendered":"http:\/\/ash.wine\/?p=290"},"modified":"2016-11-18T15:27:50","modified_gmt":"2016-11-18T09:57:50","slug":"getting-all-files-of-a-specific-type-in-a-specified-folder-using-boost-returned-in-alphabetical-order","status":"publish","type":"post","link":"http:\/\/hacks.ash.wine\/getting-all-files-of-a-specific-type-in-a-specified-folder-using-boost-returned-in-alphabetical-order\/","title":{"rendered":"Getting all files of a specific type, in a specified folder using Boost. (returned in alphabetical order)"},"content":{"rendered":"
\n

\n<\/span><\/a>Getting all files of a specific type, in a specified folder using Boost. (returned in alphabetical order)<\/h4>\n
\n
\/\/Accepts a path to a directory<\/span>\n\/\/a file extension<\/span>\n\/\/and a list<\/span>\n\/\/Puts all files matching that extension in the directory into the given list.<\/span>\n\/\/Sorts and returns the results<\/span>\nvoid<\/span> GetFilesOfTypeInDirectory<\/span>(const<\/span> boost::filesystem::path &directoryPath, const<\/span> string &fileExtension, std::vector<boost::filesystem::path> &list)\n{\n    if<\/span>(!boost::filesystem::exists<\/span>(directoryPath) || !boost::filesystem::is_directory<\/span>(directoryPath))\n    {\n      std::cerr << directoryPath << \"<\/span>is not a directory.\"<\/span><\/span> << std::endl;\n      return<\/span>;\n    }\n\n    boost::filesystem::recursive_directory_iterator it<\/span>(directoryPath);\n    boost::filesystem::recursive_directory_iterator endit;\n\n    while<\/span>(it != endit)\n    {\n        if<\/span>(boost::filesystem::is_regular_file<\/span>(*it) && it->path<\/span>().extension<\/span>() == fileExtension) list.push_back<\/span>(it->path<\/span>());\n        ++it;\n    }\n\n    \/\/Sort the list using our path comparing function<\/span>\n    std::sort<\/span>(list.begin<\/span>(), list.end<\/span>(), PathSort);\n\n}\n\nbool<\/span> PathSort<\/span>(const<\/span> boost::filesystem::path &first, const<\/span> boost::filesystem::path &second)\n{\n    return<\/span> first.filename<\/span>().string<\/span>() < second.filename<\/span>().string<\/span>();\n}<\/pre>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"

Getting all files of a specific type, in a specified folder using Boost. (returned in alphabetical order) \/\/Accepts a path to a directory \/\/a file extension \/\/and a list \/\/Puts all files matching that extension in the directory into the given list. \/\/Sorts and returns the results void GetFilesOfTypeInDirectory(const boost::filesystem::path &directoryPath, const string &fileExtension, std::vector<boost::filesystem::path> […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[23,24],"_links":{"self":[{"href":"http:\/\/ash.wine\/wp-json\/wp\/v2\/posts\/290"}],"collection":[{"href":"http:\/\/ash.wine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ash.wine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ash.wine\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/ash.wine\/wp-json\/wp\/v2\/comments?post=290"}],"version-history":[{"count":1,"href":"http:\/\/ash.wine\/wp-json\/wp\/v2\/posts\/290\/revisions"}],"predecessor-version":[{"id":291,"href":"http:\/\/ash.wine\/wp-json\/wp\/v2\/posts\/290\/revisions\/291"}],"wp:attachment":[{"href":"http:\/\/ash.wine\/wp-json\/wp\/v2\/media?parent=290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ash.wine\/wp-json\/wp\/v2\/categories?post=290"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ash.wine\/wp-json\/wp\/v2\/tags?post=290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}