Orcus
Loading...
Searching...
No Matches
Public Attributes | Static Public Attributes | List of all members
orcus::parse_quoted_string_state Struct Reference

#include <parser_global.hpp>

Public Attributes

const char * str
 
std::size_t length
 
bool transient
 
bool has_control_character
 

Static Public 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
 

Detailed Description

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.

Member Data Documentation

◆ has_control_character

bool orcus::parse_quoted_string_state::has_control_character

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

◆ transient

bool orcus::parse_quoted_string_state::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.