Orcus
Classes | Protected Member Functions | Static Protected Attributes | List of all members
orcus::yaml::parser_base Class Reference
Inheritance diagram for orcus::yaml::parser_base:
orcus::parser_base orcus::yaml_parser< _Handler >

Classes

struct  key_value
 

Protected Member Functions

 parser_base (const parser_base &)=delete
 
parser_baseoperator= (const parser_base &)=delete
 
 parser_base (const char *p, size_t n)
 
size_t parse_indent ()
 
pstring parse_to_end_of_line ()
 
void skip_comment ()
 
size_t get_scope () const
 
void push_scope (size_t scope_width)
 
scope_t get_scope_type () const
 
void set_scope_type (scope_t type)
 
size_t pop_scope ()
 
void push_line_back (const char *p, size_t n)
 
pstring pop_line_front ()
 
bool has_line_buffer () const
 
size_t get_line_buffer_count () const
 
pstring merge_line_buffer ()
 
const char * get_doc_hash () const
 
void set_doc_hash (const char *hash)
 
keyword_t parse_keyword (const char *p, size_t len)
 
key_value parse_key_value (const char *p, size_t len)
 
pstring parse_single_quoted_string_value (const char *&p, size_t max_length)
 
pstring parse_double_quoted_string_value (const char *&p, size_t max_length)
 
void skip_blanks (const char *&p, size_t len)
 
void start_literal_block ()
 
bool in_literal_block () const
 
void handle_line_in_literal (size_t indent)
 
void handle_line_in_multi_line_string ()
 
- Protected Member Functions inherited from orcus::parser_base
 parser_base (const char *p, size_t n)
 
bool has_char () const
 
bool has_next () const
 
void next (size_t inc=1)
 
void prev (size_t dec=1)
 
char cur_char () const
 
char next_char () const
 
void skip (const char *chars_to_skip)
 
bool parse_expected (const char *expected)
 
double parse_double ()
 
size_t remaining_size () const
 
std::ptrdiff_t offset () const
 

Static Protected Attributes

static const size_t parse_indent_blank_line
 
static const size_t parse_indent_end_of_stream
 
static const size_t scope_empty
 

Additional Inherited Members

- Protected Attributes inherited from orcus::parser_base
const char * mp_begin
 
const char * mp_char
 
const char * mp_end
 

Member Function Documentation

const char* orcus::yaml::parser_base::get_doc_hash ( ) const
protected

Get the hash value of current document, or nullptr if a document has not started.

Returns
hash value of current document.
size_t orcus::yaml::parser_base::parse_indent ( )
protected

Parse the prefix indent part of a line.

Returns
number of whitespace characters encountered.
pstring orcus::yaml::parser_base::parse_to_end_of_line ( )
protected

Once a non-whitespace character is reached, parse until the end of the line.

size_t orcus::yaml::parser_base::pop_scope ( )
protected

Pop the current scope and return the new scope width after the pop.

Returns
new scope width after the pop.
void orcus::yaml::parser_base::set_doc_hash ( const char *  hash)
protected

Set the hash value representing the current document. For now the memory address of the first character of the document is used as its hash value.

Parameters
hashhash value of a document.
void orcus::yaml::parser_base::skip_comment ( )
protected

Upon encountering a '#', skip until either the line-feed or the end-of-stream is reached.