#include <pfile.h>
Inheritance diagram for P::File:

Public Types | |
| enum | openMode_t { Normal, Append, Truncate } |
| File open mode. More... | |
| enum | createMode_t { OpenCreate, OpenExisting, CreateFail } |
| File creation mode. More... | |
Public Member Functions | |
| File () throw () | |
| Default constructor. | |
| File (const File &f) throw (IOError) | |
| Copy constructor. | |
| File (const char *path, accessMode_t access, openMode_t open=Normal, createMode_t create=OpenCreate, shareMode_t share=AllowNone) throw (IOError) | |
| File open constructor. | |
| ~File () throw () | |
| Destructor. | |
| void | open (const char *path, accessMode_t access, openMode_t open=Normal, createMode_t create=OpenCreate, shareMode_t share=AllowNone) throw (IOError) |
| Open a file. | |
| size_t | peek (char *buffer, size_t count) throw (IOError) |
| Peek data from file. | |
| void | truncate (off_t size) throw (IOError) |
| Truncate/extent file to given size. | |
| off_t | size () throw (IOError) |
| Returns the size of the file. | |
| void | reopen () throw (IOError) |
| Reopen's the file. | |
| const std::string & | path () const throw () |
| Returns the path of the file. | |
| File & | operator= (const File &f) throw (IOError) |
Static Public Member Functions | |
| void | unlink (const char *path) throw (IOError) |
| Delete file. | |
| bool | exists (const char *path) throw () |
| Test if filesystem entry exists. | |
| FileInfo | stat (const char *path) throw (IOError) |
| Get info about filesystem entry. | |
| File | mktemp (const char *prefix) throw (IOError) |
| Create temp file. | |
This class can be used to read, write and create objects located in the filesystem. Other operations include unlinking of a object, testing for existence, retrieving filesystem informations and creating a temporary file.
Definition at line 41 of file pfile.h.
|
|
File creation mode. The file creation mode tells File::open() which action to tkae if the file exists, and which action to take when the file does not exist. |
|
|
File open mode. Tells File::open() where to position the file pointer after opening the file. |
|
|
Default constructor.
|
|
|
Copy constructor.
|
|
||||||||||||||||||||||||
|
File open constructor. This constructor is used to construct and immediatly opening the file via open().
|
|
|
Destructor.
|
|
|
Test if filesystem entry exists.
|
|
|
Create temp file.
|
|
||||||||||||||||||||||||
|
Open a file. This method is used to open objects in the filesystem. If another file is currently opened by the object it is closed before opening the new one.
|
|
|
|
|
|
Returns the path of the file.
|
|
||||||||||||
|
Peek data from file. This method can be used to read data from a file without modifying the current file position pointer.
Reimplemented from P::IODevice. |
|
|
Reopen's the file.
|
|
|
Returns the size of the file.
|
|
|
Get info about filesystem entry.
|
|
|
Truncate/extent file to given size. Truncates or extents the file to the given size. If the file was smaller then the given size, the new allocated space is filled with zeros. The file pointer is updated to the new size of the file.
|
|
|
Delete file.
|
1.3.3