9 #ifndef CPPCOMMON_FILESYSTEM_DIRECTORY_H
10 #define CPPCOMMON_FILESYSTEM_DIRECTORY_H
44 {
Assign(path);
return *
this; }
71 std::vector<Path>
GetEntries(
const std::string& pattern =
"");
84 std::vector<Directory>
GetDirectories(
const std::string& pattern =
"");
97 std::vector<File>
GetFiles(
const std::string& pattern =
"");
110 std::vector<Symlink>
GetSymlinks(
const std::string& pattern =
"");
std::vector< File > GetFilesRecursive(const std::string &pattern="")
Recursively get all files (including symbolic link files) in the current directory.
static const Flags< FileAttributes > DEFAULT_ATTRIBUTES
Default directory attributes (Normal)
std::vector< Path > GetEntriesRecursive(const std::string &pattern="")
Recursively get all entries (directories, files, symbolic links) in the current directory.
bool IsDirectoryExists() const
Is the directory exists?
Directory(Directory &&)=default
Directory & operator=(const Directory &)=default
Directory(const Directory &)=default
void swap(Directory &directory) noexcept
Swap two instances.
DirectoryIterator begin() const
Get the directory begin iterator.
Directory(const Path &path)
Initialize directory with a given path.
Directory & operator=(Directory &&)=default
static Directory CreateTree(const Path &path, const Flags< FileAttributes > &attributes=Directory::DEFAULT_ATTRIBUTES, const Flags< FilePermissions > &permissions=Directory::DEFAULT_PERMISSIONS)
Create full directory tree of the given path.
DirectoryIterator end() const
Get the directory end iterator.
std::vector< Symlink > GetSymlinksRecursive(const std::string &pattern="")
Recursively get all symbolic links (including symbolic link directories) in the current directory.
static const Flags< FilePermissions > DEFAULT_PERMISSIONS
Default directory permissions (IRUSR | IWUSR | IXUSR | IRGRP | IXGRP | IROTH | IXOTH)
std::vector< Directory > GetDirectoriesRecursive(const std::string &pattern="")
Recursively get all directories (including symbolic link directories) in the current directory.
std::vector< Symlink > GetSymlinks(const std::string &pattern="")
Get all symbolic links (including symbolic link directories) in the current directory.
std::vector< Path > GetEntries(const std::string &pattern="")
Get all entries (directories, files, symbolic links) in the current directory.
DirectoryIterator rbegin() const
Get the directory recursive begin iterator.
std::vector< Directory > GetDirectories(const std::string &pattern="")
Get all directories (including symbolic link directories) in the current directory.
static Directory Create(const Path &path, const Flags< FileAttributes > &attributes=Directory::DEFAULT_ATTRIBUTES, const Flags< FilePermissions > &permissions=Directory::DEFAULT_PERMISSIONS)
Create directory from the given path.
std::vector< File > GetFiles(const std::string &pattern="")
Get all files (including symbolic link files) in the current directory.
Directory & operator=(const Path &path)
bool IsDirectoryEmpty() const
Is the directory empty?
Directory()
Initialize directory with an empty path.
DirectoryIterator rend() const
Get the directory recursive end iterator.
Filesystem directory iterator.
Path & Assign(const Path &path)
Assign the given path to the current one.
Flags< FileAttributes > attributes() const
Get the path file attributes.
Flags< FilePermissions > permissions() const
Get the path file permissions.
Filesystem directory inline implementation.
Filesystem directory iterator definition.
Filesystem file definition.
C++ Common project definitions.
Filesystem symlink definition.