Abstract representation of a file or directory. More...


Public Types | |
| typedef utility::path | path |
| typedef unsigned long | length_type |
Public Member Functions | |
| virtual | ~file () |
| virtual void | createFile ()=0 |
| virtual void | createDirectory (const bool createAll=false)=0 |
| virtual bool | isFile () const =0 |
| virtual bool | isDirectory () const =0 |
| virtual bool | canRead () const =0 |
| virtual bool | canWrite () const =0 |
| virtual length_type | getLength ()=0 |
| virtual const path & | getFullPath () const =0 |
| virtual bool | exists () const =0 |
| virtual ref< file > | getParent () const =0 |
| virtual void | rename (const path &newName)=0 |
| virtual void | remove ()=0 |
| virtual ref< fileWriter > | getFileWriter ()=0 |
| virtual ref< fileReader > | getFileReader ()=0 |
| virtual ref< fileIterator > | getFiles () const =0 |
Protected Member Functions | |
| file () | |
Abstract representation of a file or directory.
| typedef unsigned long length_type |
| typedef utility::path path |
| virtual ~file | ( | ) | [virtual] |
| file | ( | ) | [protected] |
| virtual bool canRead | ( | ) | const [pure virtual] |
Test whether this file is readible.
Implemented in posixFile, and windowsFile.
| virtual bool canWrite | ( | ) | const [pure virtual] |
Test whether this file is writeable.
Implemented in posixFile, and windowsFile.
| virtual void createDirectory | ( | const bool | createAll = false |
) | [pure virtual] |
Create the directory pointed by this file object.
| createAll | if set to true, recursively create all parent directories if they do not exist |
| exceptions::filesystem_exception | if an error occurs |
Implemented in posixFile, and windowsFile.
| virtual void createFile | ( | ) | [pure virtual] |
Create the file pointed by this file object.
| exceptions::filesystem_exception | if an error occurs |
Implemented in posixFile, and windowsFile.
| virtual bool exists | ( | ) | const [pure virtual] |
Test whether this file/directory exists.
Implemented in posixFile, and windowsFile.
| virtual ref<fileReader> getFileReader | ( | ) | [pure virtual] |
Return an object capable of reading from this file.
Implemented in posixFile, and windowsFile.
| virtual ref<fileIterator> getFiles | ( | ) | const [pure virtual] |
Enumerate files contained in this directory.
| exceptions::not_a_directory | if this is not a directory, exceptions::filesystem_exception if another error occurs |
Implemented in posixFile, and windowsFile.
| virtual ref<fileWriter> getFileWriter | ( | ) | [pure virtual] |
Return an object capable of writing to this file.
Implemented in posixFile, and windowsFile.
| virtual const path& getFullPath | ( | ) | const [pure virtual] |
Return the full path of this file/directory.
Implemented in posixFile, and windowsFile.
| virtual length_type getLength | ( | ) | [pure virtual] |
Return the length of this file.
Implemented in posixFile, and windowsFile.
| virtual ref<file> getParent | ( | ) | const [pure virtual] |
Return the parent directory of this file/directory.
Implemented in posixFile, and windowsFile.
| virtual bool isDirectory | ( | ) | const [pure virtual] |
Test whether this is a directory.
Implemented in posixFile, and windowsFile.
| virtual bool isFile | ( | ) | const [pure virtual] |
Test whether this is a file.
Implemented in posixFile, and windowsFile.
| virtual void remove | ( | ) | [pure virtual] |
Deletes this file/directory.
If this is a directory, it must be empty.
| exceptions::filesystem_exception | if an error occurs |
Implemented in posixFile, and windowsFile.
| virtual void rename | ( | const path & | newName | ) | [pure virtual] |
Rename the file/directory.
| newName | full path of the new file |
| exceptions::filesystem_exception | if an error occurs |
Implemented in posixFile, and windowsFile.
1.6.2