Temporary file which deletes itself upon going out of scope.
|
| | TemporaryFile (const Path &path={}, Policy policy=Policy::CreateRecursive) |
| | Constructs a TemporaryFile with a given path and policy.
|
| |
| | File (const Path &path) |
| | Create a new File instance for the given path.
|
| |
| | File (const std::string &path) |
| | Create a new File instance for the given path.
|
| |
| | File (const char *path) |
| | Create a new File instance for the given path.
|
| |
|
| operator Path () const |
| | Allow for implicit conversion to a Path.
|
| |
|
const Path & | path () const |
| | Gets the path of the file.
|
| |
|
std::string | string () const |
| | Gets the path of the file as string.
|
| |
|
Directory | parentDirectory () const |
| | Returns the absolute path to the parent directory, convenience function for Directory(path().parentPath()).
|
| |
|
Path | parentPath () const |
| | Returns the absolute path to the parent directory, convenience function for path().parentPath().
|
| |
|
std::string | name () const |
| | Gets the name of the file including the extension.
|
| |
|
bool | exists () const |
| | Checks if the file exists and actually is a file.
|
| |
| bool | isExecutable () const |
| | Checks if the file is executable (and exists).
|
| |
|
ByteSize | size () const |
| | Gets the size of the file in bytes.
|
| |
|
time_t | lastModified () const |
| | Gets the time of the last modification to the file.
|
| |
| bool | copyTo (const Path &destination, Flags< CopyOptions > copyOptions=CopyOptions::None) const |
| | Copies this single file to destination using the provided copy options.
|
| |
| bool | rename (const Path &newName) |
| | Renames the file, including extension.
|
| |
| bool | remove () const |
| | Delete the file.
|
| |
| bool | create () const |
| | Creates the file without any content.
|
| |
|
bool | createRecursive () const |
| | Create the file without any content including the parent directory if needed.
|
| |
| ByteBuffer | readBinary () const |
| | Read the entire content of the file in a binary fashion and return it as buffer.
|
| |
| std::vector< std::string > | readText () const |
| | Read the entire content of the file in a text-based fashion and return it as vector of lines.
|
| |
| bool | writeBinary (const ByteBufferView &data) const |
| | Write the given data to the file in a binary fashion.
|
| |
| bool | writeText (const std::vector< std::string > &lines) const |
| | Write the given list of strings into the file in a text-based fashion inserting a newline character (\n) after each line.
|
| |
| bool | appendBinary (const ByteBufferView &data) const |
| | Append the given data to the file in a binary fashion.
|
| |
| bool | appendText (const std::vector< std::string > &lines) const |
| | Append the given list of strings into the file in a text-based fashion inserting a newline character (\n) after each line.
|
| |
| std::ifstream | openForReading (std::ios_base::openmode openmode=std::ios_base::in) const |
| | Create an input file stream for reading from the file.
|
| |
| std::ofstream | openForWriting (std::ios_base::openmode openmode=std::ios_base::out) const |
| | Create an output file stream for writing to the file.
|
| |