parse_quoted_string_state

Defined in header: <orcus/parser_global.hpp>

struct parse_quoted_string_state

Stores state of string parsing. Upon successful parsing the str points to the first character of the string and the length stores the size of the string. When the parsing fails, the str value becomes nullptr and the length stores the error code.

Public Members

const char *str
std::size_t length
bool transient

When true, the str pointer points to the temporary buffer storage provided by the caller instead of the original character stream. The caller must allocate memory and copy the value to it before the buffer content changes if the parsed string value needs to be stored.

When false, str points to a position in the original stream, and the caller doens’t need to allocate memory to store the string value as long as the original character stream is alive.

bool has_control_character

When true, the string contains at least one control character - a character whose value ranges between 0x00 and 0x1F.

Public Static Attributes

static constexpr std::size_t error_no_closing_quote = 1
static constexpr std::size_t error_illegal_escape_char = 2
static constexpr std::size_t error_invalid_hex_digits = 3