The File class provides methods for working with a file. More...
#include <File.h>
Public Types | |
typedef FileSizeImpl | FileSize |
Public Member Functions | |
bool | canExecute () const |
Returns true iff the file is writeable. | |
bool | canRead () const |
Returns true iff the file exists. | |
bool | canWrite () const |
Returns true iff the file is readable. | |
void | copyTo (const std::string &path) const |
Timestamp | created () const |
void | createDirectories () |
bool | createDirectory () |
bool | createFile () |
bool | exists () const |
Returns the path. | |
File () | |
File (const std::string &path) | |
Creates the file. | |
File (const char *path) | |
Creates the file. | |
File (const Path &path) | |
Creates the file. | |
File (const File &file) | |
Creates the file. | |
Timestamp | getLastModified () const |
FileSize | getSize () const |
Sets the modification date of the file. | |
bool | isDevice () const |
Returns true iff the file is a directory. | |
bool | isDirectory () const |
Returns true iff the file is a symbolic link. | |
bool | isFile () const |
bool | isHidden () const |
Returns true iff the file is a device. | |
bool | isLink () const |
Returns true iff the file is a regular file. | |
void | list (std::vector< std::string > &files) const |
void | list (std::vector< File > &files) const |
void | moveTo (const std::string &path) |
bool | operator!= (const File &file) const |
bool | operator< (const File &file) const |
bool | operator<= (const File &file) const |
File & | operator= (const File &file) |
Destroys the file. | |
File & | operator= (const std::string &path) |
Assignment operator. | |
File & | operator= (const char *path) |
Assignment operator. | |
File & | operator= (const Path &path) |
Assignment operator. | |
bool | operator== (const File &file) const |
bool | operator> (const File &file) const |
bool | operator>= (const File &file) const |
const std::string & | path () const |
Swaps the file with another one. | |
void | remove (bool recursive=false) |
Renames the file to the new name. | |
void | renameTo (const std::string &path) |
void | setExecutable (bool flag=true) |
void | setLastModified (const Timestamp &ts) |
Returns the modification date of the file. | |
void | setReadOnly (bool flag=true) |
void | setSize (FileSize size) |
Returns the size of the file in bytes. | |
void | setWriteable (bool flag=true) |
void | swap (File &file) |
Assignment operator. | |
virtual | ~File () |
Copy constructor. | |
Static Public Member Functions | |
static void | handleLastError (const std::string &path) |
Protected Member Functions | |
void | copyDirectory (const std::string &path) const |
typedef FileSizeImpl Poco::File::FileSize |
Poco::File::File | ( | ) |
Poco::File::File | ( | const std::string & | path | ) |
Poco::File::File | ( | const char * | path | ) |
Poco::File::File | ( | const Path & | path | ) |
Poco::File::File | ( | const File & | file | ) |
Poco::File::~File | ( | ) | [virtual] |
bool Poco::File::canExecute | ( | ) | const |
bool Poco::File::canRead | ( | ) | const |
bool Poco::File::canWrite | ( | ) | const |
void Poco::File::copyDirectory | ( | const std::string & | path | ) | const [protected] |
void Poco::File::copyTo | ( | const std::string & | path | ) | const |
Timestamp Poco::File::created | ( | ) | const |
void Poco::File::createDirectories | ( | ) |
bool Poco::File::createDirectory | ( | ) |
bool Poco::File::createFile | ( | ) |
bool Poco::File::exists | ( | ) | const |
Timestamp Poco::File::getLastModified | ( | ) | const |
Returns the creation date of the file.
Not all platforms or filesystems (e.g. Linux and most Unix platforms with the exception of FreeBSD and Mac OS X) maintain the creation date of a file. On such platforms, created() returns the time of the last inode modification.
File::FileSize Poco::File::getSize | ( | ) | const |
void Poco::File::handleLastError | ( | const std::string & | path | ) | [static] |
Reimplemented from Poco::FileImpl.
bool Poco::File::isDevice | ( | ) | const |
bool Poco::File::isDirectory | ( | ) | const |
bool Poco::File::isFile | ( | ) | const |
bool Poco::File::isHidden | ( | ) | const |
bool Poco::File::isLink | ( | ) | const |
void Poco::File::list | ( | std::vector< std::string > & | files | ) | const |
void Poco::File::list | ( | std::vector< File > & | files | ) | const |
void Poco::File::moveTo | ( | const std::string & | path | ) |
bool Poco::File::operator!= | ( | const File & | file | ) | const [inline] |
bool Poco::File::operator< | ( | const File & | file | ) | const [inline] |
bool Poco::File::operator<= | ( | const File & | file | ) | const [inline] |
File & Poco::File::operator= | ( | const std::string & | path | ) |
File & Poco::File::operator= | ( | const char * | path | ) |
bool Poco::File::operator== | ( | const File & | file | ) | const [inline] |
bool Poco::File::operator> | ( | const File & | file | ) | const [inline] |
bool Poco::File::operator>= | ( | const File & | file | ) | const [inline] |
const std::string & Poco::File::path | ( | ) | const [inline] |
void Poco::File::remove | ( | bool | recursive = false | ) |
void Poco::File::renameTo | ( | const std::string & | path | ) |
void Poco::File::setExecutable | ( | bool | flag = true | ) |
void Poco::File::setLastModified | ( | const Timestamp & | ts | ) |
void Poco::File::setReadOnly | ( | bool | flag = true | ) |
void Poco::File::setSize | ( | FileSize | size | ) |
void Poco::File::setWriteable | ( | bool | flag = true | ) |
void Poco::File::swap | ( | File & | file | ) |