Optimizes std::filebuf for random-access reading.
More...
#include <filebuf.h>
|
| FilebufAppend () |
|
errorT | open (const std::string &filename, fileModeT fmode) |
| Opens a file and store its size. More...
|
|
unsigned long long | size () const |
| Returns the size of the file. More...
|
|
int | pubsync () |
| Invokes std::filebuf::sync() to write all pending output to the file. More...
|
|
errorT | append (const char_type *s, std::streamsize count) |
| Writes, at the end of the file, count characters from the character array whose first element is pointed to by s . More...
|
|
std::streamsize | sgetn (char_type *s, std::streamsize count) |
| Invoke filebuf::xsgetn() and update filePos_. More...
|
|
std::streamoff | pubseekpos (std::streamoff pos) |
| Repositions the internal buffer or invoke filebuf::seekpos(). More...
|
|
Optimizes std::filebuf for random-access reading.
Definition at line 184 of file filebuf.h.
◆ FilebufAppend()
FilebufAppend::FilebufAppend |
( |
| ) |
|
|
inline |
◆ append()
errorT FilebufAppend::append |
( |
const char_type * |
s, |
|
|
std::streamsize |
count |
|
) |
| |
|
inline |
Writes, at the end of the file, count
characters from the character array whose first element is pointed to by s
.
- Returns
- OK in case of success, an error code otherwise.
Definition at line 223 of file filebuf.h.
◆ open()
errorT FilebufAppend::open |
( |
const std::string & |
filename, |
|
|
fileModeT |
fmode |
|
) |
| |
|
inline |
Opens a file and store its size.
- Parameters
-
filename | path to the file to be opened. |
fmode | open the file for reading, writing, or both. |
- Returns
- OK on success, an errorT code on failure.
Definition at line 197 of file filebuf.h.
◆ pubseekpos()
std::streamoff FilebufAppend::pubseekpos |
( |
std::streamoff |
pos | ) |
|
|
inline |
Repositions the internal buffer or invoke filebuf::seekpos().
In the standard implementation, the buffer must be abandoned to ensure consistency when transitioning from reading to writing.
Definition at line 252 of file filebuf.h.
◆ pubsync()
int FilebufAppend::pubsync |
( |
| ) |
|
|
inline |
Invokes std::filebuf::sync() to write all pending output to the file.
- Returns
- 0 in case of success, -1 in case of failure.
Definition at line 216 of file filebuf.h.
◆ sgetn()
std::streamsize FilebufAppend::sgetn |
( |
char_type * |
s, |
|
|
std::streamsize |
count |
|
) |
| |
|
inline |
Invoke filebuf::xsgetn() and update filePos_.
Definition at line 241 of file filebuf.h.
◆ size()
unsigned long long FilebufAppend::size |
( |
| ) |
const |
|
inline |
Returns the size of the file.
Definition at line 210 of file filebuf.h.
The documentation for this class was generated from the following file: