Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If your platform is Win32, with C++ you can simply use Winapi functions</p> <p><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa364418%28v=vs.85%29.aspx" rel="nofollow">FindFirstFile</a></p> <p><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa364419%28v=vs.85%29.aspx" rel="nofollow">FindFirstFileEx</a></p> <p>and then</p> <p><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa364428%28v=vs.85%29.aspx" rel="nofollow">FindNextFile</a></p> <p>as filename you can give wildcards for known image formats such as jpg, jpeg, png, bmp etc.</p> <p>If you want extra speed you can run functions on different threads then synchronize the results.</p> <p>Edit:</p> <p>For platform independent solution you can you use <a href="http://www.boost.org/doc/libs/1_53_0/libs/filesystem/doc/index.htm" rel="nofollow">boost::filesystem</a> class or Qt's <a href="http://harmattan-dev.nokia.com/docs/library/html/qt4/qdir.html" rel="nofollow">QDir</a></p> <p>Sample code for searching files recursively with <a href="http://www.boost.org/doc/libs/1_53_0/libs/filesystem/doc/index.htm" rel="nofollow">boost::filesystem</a></p> <pre><code>std::string target_path( "C:\\" ); boost::regex my_filter( "*\.bmp" ); std::vector&lt; std::string &gt; all_matching_files; for ( boost::filesystem::recursive_directory_iterator end, dir(target_path); dir != end; ++dir ) { // Skip if not a file if( !boost::filesystem::is_regular_file( i-&gt;status() ) ) continue; boost::smatch what; // Skip if no match if( !boost::regex_match( i-&gt;leaf(), what, my_filter ) ) continue; // File matches, store it all_matching_files.push_back( i-&gt;leaf() ); } </code></pre> <p>For a better implenetation I strongly offer you to read <a href="http://www.boost.org/doc/libs/1_53_0/libs/filesystem/doc/index.htm" rel="nofollow">boost::filesystem</a> documentation</p> <p>For <a href="http://harmattan-dev.nokia.com/docs/library/html/qt4/qdir.html" rel="nofollow">QDir</a> Example</p> <pre><code>filesStack = new QStack&lt;QString&gt;(); QDir selectedDir("C:\\"); selectedDir.setFilter(QDir::Files | QDir::Dirs | QDir::NoDot | QDir::NoDotDot); QStringList qsl; qsl.append("*.bmp"); selectedDir.setNameFilters(qsl); findFilesRecursively(selectedDir); void findFilesRecursively(QDir rootDir) { QDirIterator it(rootDir, QDirIterator::Subdirectories); while(it.hasNext()) { filesStack-&gt;push(it.next()); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload