mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-09 21:42:13 +00:00
b004e2479c
Work In Progress - added support for multiple paths in SoundManager. Signed-off-by: Lukasz Gromanowski <lgromanowski@gmail.com>
29 lines
700 B
C++
29 lines
700 B
C++
#include "search.hpp"
|
|
|
|
#include <iostream>
|
|
|
|
void FileFinder::find(const boost::filesystem::path & dir_path, ReturnPath &ret, bool recurse)
|
|
{
|
|
if ( !boost::filesystem::exists( dir_path ) )
|
|
{
|
|
std::cout << "Path " << dir_path << " not found" << std::endl;
|
|
return;
|
|
}
|
|
|
|
boost::filesystem::directory_iterator end_itr; // default construction yields past-the-end
|
|
for (boost::filesystem::directory_iterator itr(dir_path); itr != end_itr; ++itr)
|
|
{
|
|
if (boost::filesystem::is_directory( *itr ))
|
|
{
|
|
if (recurse)
|
|
{
|
|
find(*itr, ret);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
ret.add(*itr);
|
|
}
|
|
}
|
|
}
|