|
ActiveLib
|
Class to represent a directory. More...
#include <Directory.h>


Public Types | |
| using | Unique = std::unique_ptr<Directory> |
| Unique pointer. | |
| using | iterator = std::filesystem::directory_iterator |
Public Types inherited from active::file::FSNode | |
| using | Unique = std::unique_ptr<FSNode> |
| Unique pointer. | |
| using | Shared = std::shared_ptr<FSNode> |
| Unique pointer. | |
Public Member Functions | |
| Directory () | |
| Directory (const Path &path, bool isMissingCreated=false, bool canReplaceFile=false) | |
| Directory (const Directory &parent, const utility::String &name, bool isMissingCreated=false, bool canReplaceFile=false) | |
| Directory (const Directory &source) noexcept | |
| virtual Directory * | clonePtr () const override |
| iterator | begin () const |
| iterator | end () const |
Public Member Functions inherited from active::file::FSNode | |
| FSNode () noexcept | |
| FSNode (const Path &path) | |
| FSNode (const FSNode &source) noexcept | |
| virtual | ~FSNode () noexcept=default |
| FSNode & | operator= (const FSNode &source) |
| bool | operator== (const FSNode &ref) const noexcept |
| Path | getPath () const noexcept |
| virtual bool | exists () const |
| virtual bool | isDirectory () const |
| utility::Time | getModificationTime () const |
| virtual void | setPath (const Path &path) |
| virtual void | moveTo (const Path &path) |
| virtual void | rename (const utility::String &name) |
| virtual void | remove (bool isRecursive=true) |
Public Member Functions inherited from active::utility::Cloner | |
| virtual | ~Cloner ()=default |
Static Public Member Functions | |
| static Directory | current () |
| static Directory | temporary () |
Additional Inherited Members | |
Static Public Attributes inherited from active::file::FSNode | |
| static const utility::String | pathDelimiter |
| The path delimiter expression for the current platform. | |
Protected Member Functions inherited from active::file::FSNode | |
| bool | isMine () const noexcept |
| void | setMine (bool state) noexcept |
Class to represent a directory.
| Directory::Directory | ( | ) |
Constructor

| Directory::Directory | ( | const Path & | path, |
| bool | isMissingCreated = false, | ||
| bool | canReplaceFile = false ) |
Constructor
| path | A full path to the directory |
| isMissingCreated | True if the folder should be created when missing |
| canReplaceFile | True if the directory can be created and replace an existing file with the same name |
| std::ios_base::failure | Thrown if isMissingCreated = true and the directory cannot be created |

| Directory::Directory | ( | const Directory & | parent, |
| const utility::String & | name, | ||
| bool | isMissingCreated = false, | ||
| bool | canReplaceFile = false ) |
Constructor
| parent | The parent directory |
| name | The directory name |
| isMissingCreated | True if the folder should be created when missing |
| canReplaceFile | True if the directory can be created and replace an existing file with the same name |
| std::ios_base::failure | Thrown if isMissingCreated = true and the directory cannot be created |
|
noexcept |
Copy constructor
| source | The object to copy |
| Directory::iterator Directory::begin | ( | ) | const |
Get an iterator at the first directory entry

|
inlineoverridevirtual |
Clone method
Implements active::utility::Cloner.

|
static |
Get the current directory
| std::filesystem::filesystem_error | Throws if an error occurs |

| Directory::iterator Directory::end | ( | ) | const |
Get an iterator at the directory end (past the last entry)
|
static |
Get a directory for temporary files
| std::bad_alloc::filesystem_error | Throws if memory allocation occurs |
