|
VideoTools
|
A simple static class for dealing with files. More...
#include <gfile.h>
Classes | |
| class | NoThrow |
| An overload discriminator class for File methods. More... | |
Static Public Member Functions | |
| static bool | remove (const Path &path, const NoThrow &) |
| Deletes the file or directory. Returns false on error. | |
| static void | remove (const Path &path) |
| Deletes the file or directory. Throws an exception on error. | |
| static bool | rename (const Path &from, const Path &to, const NoThrow &) |
| Renames the file. Returns false on error. | |
| static void | rename (const Path &from, const Path &to) |
| Renames the file. | |
| static bool | copy (const Path &from, const Path &to, const NoThrow &) |
| Copies a file. Returns false on error. | |
| static void | copy (const Path &from, const Path &to) |
| Copies a file. | |
| static void | copy (std::istream &from, std::ostream &to, std::streamsize limit=0U, std::string::size_type block=0U) |
| Copies a stream with an optional size limit. | |
| static bool | mkdirs (const Path &dir, const NoThrow &, int=100) |
| Creates a directory and all necessary parents. More... | |
| static void | mkdirs (const Path &dir, int=100) |
| Creates a directory and all necessary parents. More... | |
| static bool | mkdir (const Path &dir, const NoThrow &) |
| Creates a directory. Returns false on error. | |
| static void | mkdir (const Path &dir) |
| Creates a directory. | |
| static std::string | sizeString (const Path &file) |
| Returns the file's size in string format. More... | |
| static bool | exists (const Path &file) |
| Returns true if the file (directory, device etc.) exists. More... | |
| static bool | exists (const Path &file, const NoThrow &) |
| Returns true if the file (directory, device etc.) exists. More... | |
| static bool | isDirectory (const Path &path) |
| Returns true if the path exists() and is a directory. More... | |
| static EpochTime | time (const Path &file) |
| Returns the file's timestamp. | |
| static EpochTime | time (const Path &file, const NoThrow &) |
| Returns the file's timestamp. More... | |
| static void | chmodx (const Path &file) |
| Makes the file executable. | |
| static bool | chmodx (const Path &file, const NoThrow &) |
| Makes the file executable. | |
| static void | link (const Path &target, const Path &new_link) |
| Creates a symlink. | |
| static bool | link (const Path &target, const Path &new_link, const NoThrow &) |
| Creates a symlink. | |
| static bool | executable (const Path &) |
| Returns true if the path is probably executable. More... | |
| static void | create (const Path &) |
| Creates an empty file. Throws on error. | |
Friends | |
| class | G::DirectoryIteratorImp |
A simple static class for dealing with files.
|
static |
Returns true if the path is probably executable.
Because of portability and implementation difficulties this does not return a definitive result so it should only used for generating warnings on a false return.
Definition at line 73 of file gfile_unix.cpp.
|
static |
|
static |
Returns true if the path exists() and is a directory.
Symlinks are followed.
Definition at line 67 of file gfile_unix.cpp.
|
static |
|
static |
Returns the file's size in string format.
Returns the empty string on error.
Definition at line 90 of file gfile_unix.cpp.
|
static |
Returns the file's timestamp.
Returns EpochTime(0) on error.
Definition at line 109 of file gfile_unix.cpp.