diff options
Diffstat (limited to 'src/filesystem/directory.h')
-rw-r--r-- | src/filesystem/directory.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/src/filesystem/directory.h b/src/filesystem/directory.h new file mode 100644 index 0000000..cdd9870 --- /dev/null +++ b/src/filesystem/directory.h @@ -0,0 +1,67 @@ +/* + filesystem/directory.h + This file is part of the Osirion project and is distributed under + the terms of the GNU General Public License version 2 +*/ + +#ifndef __INCLUDED_FILESYSTEM_DIRECTORY_H__ +#define __INCLUDED_FILESYSTEM_DIRECTORY_H__ + +// C++ headers +#include <string> +#include <list> + +namespace filesystem +{ + +/** + * @brief an abstract interface to handle file access + */ +class Directory { + +public: + typedef std::list<std::string> FileNames; + + Directory(); + + Directory(const std::string & location); + + ~Directory(); + + // inspectors + + /** + * @brief returns the underlying filesystem location + */ + inline const std::string & location() const { + return directory_location; + } + + inline const FileNames & filenames() const { + return directory_filenames; + } + + // mutators + + /** + * @brief set the underlying filesystem location + */ + void set_location(const std::string & location); + + /** + * @brief read the filenames from current filesystem location + */ + void read(); + + void clear(); +private: + + std::string directory_location; + + FileNames directory_filenames; +}; + +} // namespace filesystem + +#endif // __INCLUDED_FILESYSTEM_DIRECTORY_H__ + |