56 std::string fullFilename =
m_root + name;
58 bfs::path fullPath(fullFilename);
59 std::ifstream file(fullPath.string().c_str());
72 return list(path,
false);
76 return list(path,
true);
80 std::set<std::string>
list;
85 dir.append(path.substr(1));
92 bfs::path boost_path(dir);
93 if (!bfs::exists(boost_path) || !bfs::is_directory(boost_path))
96 bfs::directory_iterator end;
97 for (bfs::directory_iterator i(boost_path); i != end; ++i) {
98 if (bfs::is_directory(*i) != directorys)
102 if (!filename.empty())
104 list.insert(filename);
108 catch (
const bfs::filesystem_error& ex) {
std::set< std::string > listFiles(const std::string &path) const
List files in a directory.
VFSDirectory(VFS *vfs, const std::string &root="./")
Constructor Creates the given file system's VFS Source, Uses boost_filesystem to achieve Plattform in...
Helper class to create log strings out from separate parts Usage: LMsg("some text") << variable << "...
VFSSource abstract baseclass.
std::string GetFilenameFromDirectoryIterator(const bfs::directory_iterator &iter)
Helper function to retrieve a filename string from a directory iterator.
static Logger _log(LM_AUDIO)
A RawDataSource for a file on the host system.
virtual bool fileExists(const std::string &filename) const
Tests whether a file can be opened.
std::set< std::string > listDirectories(const std::string &path) const
List directories in a directory.
std::set< std::string > list(const std::string &path, bool directorys) const
virtual ~VFSDirectory()
Destructor.
the main VFS (virtual file system) class
#define FL_DBG(logger, msg)
virtual RawData * open(const std::string &filename) const
Opens a file.
Used to access diffrent kinds of data.