#include <core_io_reader.h>

Public Member Functions | |
| CoreIOReader (FILE *_inputBuffer, bool _isUnicode, LineEndingType _lnEnding=CC_LN_NATIVE) | |
| The constructor. | |
| virtual | ~CoreIOReader () |
| The destructor. | |
| virtual bool | EndOfFile () |
| Determines whether the end of the file has been reached. | |
| virtual cc_int64_t | Length () |
| Determines the length of the file buffer. | |
| virtual bool | IsOpen () |
| Validates that the file buffer isn't NULL. | |
| virtual int | Read (char *_buffer, size_t _bufferLength, size_t _bufferIndex, size_t _count) |
| Reads a block of data from the file buffer. | |
| virtual int | ReadLine (std::string &_string) |
| Reads a line of data. | |
| virtual int | ReadLine (char *_buffer, size_t _bufferLength) |
| Reads a line of data. | |
| virtual CrissCross::Errors | SetLineEndings (LineEndingType _ending) |
| Sets the line ending convention used by this CoreIOReader instance. | |
| virtual cc_int64_t | Position () |
| Gets the current position in the buffer. | |
| virtual int | Seek (cc_int64_t _position) |
| Seeks to a location in the buffer. | |
| virtual int | Forward (cc_int64_t _position) |
| Moves forward to a location in the buffer. | |
| void | Flush () |
| Flushes the input buffer. | |
Protected Member Functions | |
| int | Seek (cc_int64_t _position, int _origin) |
| Seeks to a location in the buffer. | |
Protected Attributes | |
| char | m_lineEnding [4] |
| Line ending buffer. | |
| FILE * | m_fileInputPointer |
| Input/output FILE pointer. | |
| bool | m_unicode |
| Indicates whether the buffer is to be read in unicode or not. (UNIMPLEMENTED). | |
| CrissCross::System::Mutex | m_ioMutex |
| Thread-safe mutex. | |
A class inherited by most I/O classes, including Console and FileReader.
| CoreIOReader | ( | FILE * | _inputBuffer, | |
| bool | _isUnicode, | |||
| LineEndingType | _lnEnding = CC_LN_NATIVE | |||
| ) |
The constructor.
Creates a new CoreIOReader instance. Will initialize line endings to the platform's default, also initializes CoreIOReader::m_ioMutex.
| _inputBuffer | The buffer to be used for read operations. | |
| _isUnicode | The buffer is going to be a Unicode read buffer. (UNIMPLEMENTED) | |
| _lnEnding | The line ending to use. |
| virtual bool EndOfFile | ( | ) | [virtual] |
Determines whether the end of the file has been reached.
Reimplemented in Console.
| virtual int Forward | ( | cc_int64_t | _position | ) | [virtual] |
Moves forward to a location in the buffer.
| _position | Position to seek to, relative to the current position in the buffer. |
Reimplemented in Console.
| virtual bool IsOpen | ( | ) | [virtual] |
Validates that the file buffer isn't NULL.
| virtual cc_int64_t Length | ( | ) | [virtual] |
Determines the length of the file buffer.
Reimplemented in Console.
| virtual cc_int64_t Position | ( | ) | [virtual] |
Gets the current position in the buffer.
| virtual int Read | ( | char * | _buffer, | |
| size_t | _bufferLength, | |||
| size_t | _bufferIndex, | |||
| size_t | _count | |||
| ) | [virtual] |
Reads a block of data from the file buffer.
| _buffer | The output buffer to read to. | |
| _bufferLength | The size of _buffer (in bytes). | |
| _bufferIndex | The position in _buffer to begin writing. | |
| _count | The number of bytes to read. |
Reimplemented in Console.
| virtual int ReadLine | ( | char * | _buffer, | |
| size_t | _bufferLength | |||
| ) | [virtual] |
Reads a line of data.
| _buffer | A character buffer for the data to be stored in. | |
| _bufferLength | The length of the buffer specified in _buffer. |
| virtual int ReadLine | ( | std::string & | _string | ) | [virtual] |
Reads a line of data.
Data returned by this function should be copied to another location before being parsed.
| _string | A reference of an std::string where the data will be stored. |
| int Seek | ( | cc_int64_t | _position, | |
| int | _origin | |||
| ) | [protected] |
Seeks to a location in the buffer.
| _position | Position to seek to, relative to _origin. | |
| _origin | Can be one of SEEK_SET, SEEK_CUR, or SEEK_END. |
| virtual int Seek | ( | cc_int64_t | _position | ) | [virtual] |
Seeks to a location in the buffer.
| _position | Position to seek to, relative to the first byte of the buffer. |
Reimplemented in Console.
| virtual CrissCross::Errors SetLineEndings | ( | LineEndingType | _ending | ) | [virtual] |
Sets the line ending convention used by this CoreIOReader instance.
| _ending | Any of the LineEndingType values. |
CrissCross::System::Mutex m_ioMutex [protected] |
Thread-safe mutex.
Prevents more than one read from occurring simultaneously.
char m_lineEnding[4] [protected] |
Line ending buffer.
Stores the line ending selected by CoreIOReader::SetLineEndings.
1.5.8