|
SFCGAL
2.3.0
|
Helper class to parse data from stream. More...
#include <InputStreamReader.h>
Public Types | |
| using | char_type = CharType |
| Character type for the reader. More... | |
| using | string_type = typename std::basic_string< char_type > |
| String type for the reader. More... | |
| using | istream_type = typename std::basic_istream< char_type > |
| Input stream type. More... | |
| using | pos_type = typename std::basic_istream< char_type >::pos_type |
| Stream position type. More... | |
Public Member Functions | |
| BasicInputStreamReader (istream_type &s, bool skipWhiteSpaces=true) | |
| Constructor with an input stream. More... | |
| auto | match (char_type const &c) -> bool |
| Try to match a char in the input stream. More... | |
| auto | imatch (char_type const &c) -> bool |
| Try to match a char in the input stream, case-insensitive variant. More... | |
| auto | match (string_type const &str) -> bool |
| Try to match a string in the input stream. More... | |
| auto | imatch (string_type const &str) -> bool |
| Try to match a string in the input stream, case-insensitive variant. More... | |
| template<typename T > | |
| bool | read (T &value) |
| Try to read a value in the input stream, restore state if read fails. More... | |
| auto | readBytes (std::string &buffer, size_t bytesToRead) -> void |
| Read bytes from input stream into buffer. More... | |
| void | begin () |
| save input stream state (read position) More... | |
| void | commit () |
| validate read from input stream More... | |
| void | rollback () |
| restore stream state (read position) More... | |
| bool | eof () const |
| Test if read is complete (either tried to read after eof, either on eof) More... | |
| istream_type & | s () |
| Returns the wrapped stream. More... | |
| istream_type const & | s () const |
| Returns the wrapped stream. More... | |
| string_type | context (size_t nMax=20) |
| Returns a string corresponding to the current state. More... | |
Helper class to parse data from stream.
| using SFCGAL::tools::BasicInputStreamReader< CharType >::char_type = CharType |
Character type for the reader.
| using SFCGAL::tools::BasicInputStreamReader< CharType >::istream_type = typename std::basic_istream<char_type> |
Input stream type.
| using SFCGAL::tools::BasicInputStreamReader< CharType >::pos_type = typename std::basic_istream<char_type>::pos_type |
Stream position type.
| using SFCGAL::tools::BasicInputStreamReader< CharType >::string_type = typename std::basic_string<char_type> |
String type for the reader.
|
inline |
Constructor with an input stream.
| s | The input stream to read from |
| skipWhiteSpaces | Whether to skip white spaces during parsing |
|
inline |
save input stream state (read position)
|
inline |
validate read from input stream
|
inline |
Returns a string corresponding to the current state.
| nMax | Maximum number of characters to include in context |
|
inline |
Test if read is complete (either tried to read after eof, either on eof)
|
inline |
Try to match a char in the input stream, case-insensitive variant.
| c | The character to match |
|
inline |
Try to match a string in the input stream, case-insensitive variant.
| str | The string to match |
|
inline |
Try to match a char in the input stream.
| c | The character to match |
|
inline |
Try to match a string in the input stream.
| str | The string to match |
|
inline |
Try to read a value in the input stream, restore state if read fails.
| value | Reference to store the read value |
|
inline |
Read bytes from input stream into buffer.
| buffer | String buffer to store read bytes |
| bytesToRead | Number of bytes to read |
|
inline |
restore stream state (read position)
|
inline |
Returns the wrapped stream.
|
inline |
Returns the wrapped stream.
1.8.10