Class to allow iteration over all lines of a text file.
More...
#include <file_line_reader.h>
Class to allow iteration over all lines of a text file.
◆ strip_type
Enumeration of whether the delimiter should be stripped.
Enumerator |
---|
strip_delimiter | The delimiter should be stripped.
|
no_strip_delimiter | The delimiter should be retained.
|
◆ file_line_reader()
Constructor.
- Parameters
-
stream | the file stream to read from |
delimiter | the delimiter between text `lines' (default to LF) |
strip | enumerator about whether to strip the delimiter |
◆ ~file_line_reader()
nvwa::file_line_reader::~file_line_reader |
( |
| ) |
|
◆ read()
bool nvwa::file_line_reader::read |
( |
char *& |
output, |
|
|
size_t & |
size, |
|
|
size_t & |
capacity |
|
) |
| |
Reads content from the file stream.
If necessary, the receiving buffer will be expanded so that it is big enough to contain all the line content.
- Parameters
-
[in,out] | output | initial receiving buffer |
[out] | size | size of the line |
[in,out] | capacity | capacity of the initial receiving buffer on entering the function; it can be increased when necessary |
- Returns
true
if line content is returned; false
otherwise
The documentation for this class was generated from the following files: