File byte stream for input using fread().
More...
#include <filereadstream.h>
|
typedef char | Ch |
| Character type (byte).
|
|
- Note
- implements Stream concept
Definition at line 34 of file filereadstream.h.
◆ Ch
◆ FileReadStream()
FileReadStream::FileReadStream |
( |
std::FILE * | fp, |
|
|
char * | buffer, |
|
|
size_t | bufferSize ) |
|
inline |
- Parameters
-
fp | File pointer opened for read. |
buffer | user-supplied buffer. |
bufferSize | size of buffer in bytes. Must >=4 bytes. |
Definition at line 44 of file filereadstream.h.
44 : fp_(fp), buffer_(buffer), bufferSize_(bufferSize), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) {
47 Read();
48 }
#define RAPIDJSON_ASSERT(x)
Assertion.
◆ Flush()
void FileReadStream::Flush |
( |
| ) |
|
|
inline |
◆ Peek()
Ch FileReadStream::Peek |
( |
| ) |
const |
|
inline |
◆ Peek4()
const Ch * FileReadStream::Peek4 |
( |
| ) |
const |
|
inline |
Definition at line 61 of file filereadstream.h.
61 {
62 return (current_ + 4 - !eof_ <= bufferLast_) ? current_ : 0;
63 }
◆ Put()
void FileReadStream::Put |
( |
Ch | | ) |
|
|
inline |
◆ PutBegin()
Ch * FileReadStream::PutBegin |
( |
| ) |
|
|
inline |
◆ PutEnd()
size_t FileReadStream::PutEnd |
( |
Ch * | | ) |
|
|
inline |
◆ Take()
Ch FileReadStream::Take |
( |
| ) |
|
|
inline |
Definition at line 51 of file filereadstream.h.
51{
Ch c = *current_; Read();
return c; }
char Ch
Character type (byte).
◆ Tell()
size_t FileReadStream::Tell |
( |
| ) |
const |
|
inline |
Definition at line 52 of file filereadstream.h.
52{ return count_ + static_cast<size_t>(current_ - buffer_); }
The documentation for this class was generated from the following file: