Changeset 8226 in orxonox.OLD for branches/gui/src/lib/util/directory.h
- Timestamp:
- Jun 8, 2006, 10:49:15 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/util/directory.h
r8224 r8226 40 40 bool create(); 41 41 42 /** @returns if the Directory was opened */ 43 bool isOpen() const { return this->_opened; } 44 /** @returns the FileCount (count of files contained in this directory) */ 45 unsigned int fileCount() const { return _fileNames.size(); }; 42 46 /** @returns the FileNames contained inside of the Directory */ 43 47 const std::vector<std::string>& fileNames() const { return this->_fileNames; }; 48 /** @returns the i'th FileName @param fileNumber the fileNumber (must not bigger than fileCount()) */ 44 49 const std::string& operator[](unsigned int fileNumber) const { return this->_fileNames[fileNumber]; }; 45 unsigned int fileCount() const { return _fileNames.size(); }; 46 50 /** @returns a formated string containing the FileName, prepended with the directory-Name */ 47 51 std::string fileNameInDir(unsigned int fileNumber) const { return this->name() + "/" + _fileNames[fileNumber]; }; 48 52 /** @returns a File pointing to the File @param fileNumber the fileNumber (must not bigger than fileCount()) */ 49 53 File getFile(unsigned int fileNumber) const { return File(fileNameInDir(fileNumber)); }; 50 54 51 55 private: 52 bool _opened; 53 std::vector<std::string> _fileNames; 56 bool _opened; //!< If the directory was opened. 57 std::vector<std::string> _fileNames; //!< The List of Files contained in the directory. (will be filled when open was called.) 54 58 }; 55 59
Note: See TracChangeset
for help on using the changeset viewer.