Inviwo
0.9.10.1
Inviwo documentation
|
#include <tinydirinterface.h>
Public Types | |
enum | ListMode { FilesOnly, DirectoriesOnly, FilesAndDirectories } |
Public Member Functions | |
TinyDirInterface (TinyDirInterface const &)=delete | |
TinyDirInterface & | operator= (TinyDirInterface const &)=delete |
bool | open (const std::string &path) |
Opens the given path as directory resource. More... | |
void | close () |
Closes any open directory resource. Directory contents can no longer be listed. The resource will automatically be closed on deconstruction of this object. More... | |
bool | isOpen () const |
Returns whether a directory resource is open, i.e. available, for querying. More... | |
void | setListMode (ListMode mode) |
Set the current mode used for listing the directory. More... | |
ListMode | getListMode () const |
Returns the current mode used for listing the directory. More... | |
bool | isNextEntryAvailable () const |
Returns whether the directory resource can be queried for another entry. More... | |
std::string | getNextEntry () |
Queries the directory for the next entry. The current ListMode determines what contents will be returned. An empty string is returned in case the resource is closed or no further file is available. Querying the last file automatically closes the directory resource. More... | |
std::string | getNextEntryWithBasePath () |
Convenience function for getNextEntry including the base path. More... | |
std::vector< std::string > | getContents () |
Queries the directory for all entries. The current ListMode determines what contents will be returned. An empty vector is returned in case the resource is closed. This function will close the directory resource. More... | |
std::vector< std::string > | getContentsWithBasePath () |
Convenience function for getContents including the base path. More... | |
Protected Member Functions | |
std::string | getNextEntry (bool includeBasePath) |
Interface for tinydir responsible for listing files in a directory. Depending on the list mode (default ListMode::FilesOnly), the result contains files, directories or both.
void inviwo::TinyDirInterface::close | ( | ) |
Closes any open directory resource. Directory contents can no longer be listed. The resource will automatically be closed on deconstruction of this object.
std::vector< std::string > inviwo::TinyDirInterface::getContents | ( | ) |
Queries the directory for all entries. The current ListMode determines what contents will be returned. An empty vector is returned in case the resource is closed. This function will close the directory resource.
FileException |
std::vector< std::string > inviwo::TinyDirInterface::getContentsWithBasePath | ( | ) |
Convenience function for getContents including the base path.
FileException |
TinyDirInterface::ListMode inviwo::TinyDirInterface::getListMode | ( | ) | const |
Returns the current mode used for listing the directory.
std::string inviwo::TinyDirInterface::getNextEntry | ( | ) |
Queries the directory for the next entry. The current ListMode determines what contents will be returned. An empty string is returned in case the resource is closed or no further file is available. Querying the last file automatically closes the directory resource.
FileException |
std::string inviwo::TinyDirInterface::getNextEntryWithBasePath | ( | ) |
Convenience function for getNextEntry including the base path.
FileException |
bool inviwo::TinyDirInterface::isNextEntryAvailable | ( | ) | const |
Returns whether the directory resource can be queried for another entry.
bool inviwo::TinyDirInterface::isOpen | ( | ) | const |
Returns whether a directory resource is open, i.e. available, for querying.
bool inviwo::TinyDirInterface::open | ( | const std::string & | path | ) |
void inviwo::TinyDirInterface::setListMode | ( | ListMode | mode | ) |
Set the current mode used for listing the directory.
mode | new listing mode |