A general file access class.
More...
#include <Files.h>
A general file access class.
| Enumerator |
|---|
| REGULAR |
A regular file.
|
| DIRECTORY |
A directory.
|
| CHARACTER |
A character device.
|
| BLOCK |
A block device.
|
| FIFO |
A fifo see fifo(7)
|
| LINK |
Either a symbolic or hard link.
|
| SOCK |
A unix socket.
|
| TEMPORARY |
Really just a regular file, but will be removed destruction.
|
| UNKNOWN |
Either not implemented yet or an error occured.
|
| trippingcyril::File::File |
( |
const String & |
path | ) |
|
| virtual trippingcyril::File::~File |
( |
| ) |
|
|
virtual |
| virtual bool trippingcyril::File::Chmod |
( |
mode_t |
mode | ) |
|
|
virtual |
- Returns
- true if permissions were successfully modified.
| void trippingcyril::File::Close |
( |
| ) |
|
|
overridevirtual |
| virtual bool trippingcyril::File::Copy |
( |
const String & |
newpath, |
|
|
bool |
overwrite = false |
|
) |
| |
|
virtual |
- Returns
- true if successfully copied.
| virtual bool trippingcyril::File::Delete |
( |
| ) |
|
|
virtual |
- Returns
- true if successfully deleted.
| virtual bool trippingcyril::File::Exists |
( |
| ) |
const |
|
virtual |
- Returns
- true if the file exists
| virtual time_t trippingcyril::File::GetATime |
( |
| ) |
const |
|
virtual |
- Returns
- Last access time of this file.
| virtual time_t trippingcyril::File::GetCTime |
( |
| ) |
const |
|
virtual |
- Returns
- Creation time of this file.
| virtual gid_t trippingcyril::File::GetGID |
( |
| ) |
const |
|
virtual |
| virtual time_t trippingcyril::File::GetMTime |
( |
| ) |
const |
|
virtual |
- Returns
- Last modification time of this file.
| String trippingcyril::File::GetName |
( |
| ) |
const |
|
inline |
- Returns
- The path of this file, may be relative depends on what you passed to the constructor
| String trippingcyril::File::GetShortName |
( |
| ) |
const |
|
inline |
- Returns
- The filename without any path.
| virtual off_t trippingcyril::File::GetSize |
( |
| ) |
const |
|
virtual |
- Returns
- The size of the file, only works with REGULAR files, 0 otherwise
| virtual FileType trippingcyril::File::GetType |
( |
| ) |
const |
|
virtual |
| virtual uid_t trippingcyril::File::GetUID |
( |
| ) |
const |
|
virtual |
| bool trippingcyril::File::IsOpen |
( |
| ) |
const |
|
inline |
- Returns
- true if successfully opened with Open()
- See Also
- Open
| virtual bool trippingcyril::File::Move |
( |
const String & |
newpath, |
|
|
bool |
overwrite = false |
|
) |
| |
|
virtual |
- Returns
- true if successfully moved.
| virtual bool trippingcyril::File::Open |
( |
int |
flags = O_RDONLY, |
|
|
mode_t |
mode = 0644 |
|
) |
| |
|
virtual |
- Returns
- true if successfully opened, similar to open(2)
| virtual int trippingcyril::File::Read |
( |
char * |
buffer, |
|
|
size_t |
len |
|
) |
| |
|
virtual |
- Returns
- The amount of bytes read into the buffer, similar to read(2)
| virtual bool trippingcyril::File::ReadFile |
( |
String & |
data, |
|
|
size_t |
maxSize = 512 *1024 |
|
) |
| |
|
virtual |
Reads up until maxSize into data
- Parameters
-
| data | Reference to a string to read into, string is purely used as a buffer |
| maxSize | The maximum amount of bytes to read into our buffer |
- Returns
- true if the file was entirely read into our buffer
| virtual bool trippingcyril::File::ReadLine |
( |
String & |
data, |
|
|
const String & |
delimiter = "\n" |
|
) |
| |
|
virtual |
Reads up to the delimiter into data
- Parameters
-
| data | Reference to a string to read into, string is purely used as a buffer |
| delimiter | Up until what character we should read |
- Returns
- true if the delimiter was found
| virtual bool trippingcyril::File::Seek |
( |
off_t |
pos, |
|
|
int |
whence = SEEK_SET |
|
) |
| |
|
virtual |
- Returns
- true if successfully moved to this spot in the file, similar to lseek(2)
| virtual bool trippingcyril::File::Sync |
( |
| ) |
|
|
virtual |
- Returns
- true if successfully synchronized, similar to fsync(2)
| virtual off_t trippingcyril::File::Tell |
( |
| ) |
|
|
virtual |
- Returns
- The current position in the file
| virtual bool trippingcyril::File::Truncate |
( |
off_t |
len = 0 | ) |
|
|
virtual |
- Returns
- true if successfully truncated, similar to truncate(2)
| virtual int trippingcyril::File::Write |
( |
const char * |
buffer, |
|
|
size_t |
len |
|
) |
| |
|
overridevirtual |
The documentation for this class was generated from the following file: