Public Types |
typedef off_t | offset_type |
| Large file offset type.
|
typedef off_t | library_offset_type |
| IO library offset type.
|
Public Methods |
| File () |
| ~File () |
void | open (const std::string &fileName, int mode) |
void | close () |
| Closes the File, closing all segments.
|
void | read (void *buffer, offset_type count) |
| Read count bytes into buffer from File.
|
void | write (const void *buffer, offset_type count) |
| Write count bytes from buffer into File.
|
void | seekg (offset_type relativePosition, std::fstream::seekdir direction) |
| Move the get pointer.
|
void | seekp (offset_type relativePosition, std::fstream::seekdir direction) |
| Move the put pointer.
|
offset_type | tellg () |
| Return the value of the get pointer.
|
offset_type | tellp () |
| Return the value of the put pointer.
|
offset_type | gcount () |
| Return the number of bytes read by last read.
|
int | rdstate () |
| Returns eof bit set if at end of File.
|
offset_type | size () const |
| Returns size of last segment in file.
|
void | unlink () |
| Close and remove File, and all segments from filesystem.
|
Static Public Methods |
void | unlink (const std::string &fileName) |
| Remove each segment from filesystem.
|
void | rename (const std::string &oldName, const std::string &newName) |
| Rename File from oldName to newName. Renames all segments.
|
Private Methods |
void | _appendSegment () |
offset_type | _absolutePosition (offset_type relativePosition, offset_type currentPosition, std::fstream::seekdir direction) const |
FileSegment * | _segmentForPosition (offset_type absolutePosition, FileSegment *guess) |
void | _validateReadPointer () |
void | _validateWritePointer () |
Static Private Methods |
std::string | segmentName (const std::string &fileName, int segment) |
Private Attributes |
std::string | _fileName |
std::vector< FileSegment * > | _segments |
FileSegment * | _readSegment |
FileSegment * | _writeSegment |
offset_type | _readPosition |
offset_type | _writePosition |
offset_type | _readCount |
bool | _readPointerValid |
bool | _writePointerValid |
int | _mode |
int | _state |