basic-xml 1.0.1
Very basic loader/writer of XML tags with attributes and content.
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
basic_xml::parser Class Reference

Public Member Functions

 parser (std::string const &filename, std::istream &in, node::pointer_t &root)
 

Private Types

enum class  token_t {
  TOK_CLOSE_TAG , TOK_EMPTY_TAG , TOK_END_TAG , TOK_EOF ,
  TOK_EQUAL , TOK_IDENTIFIER , TOK_OPEN_TAG , TOK_PROCESSOR ,
  TOK_STRING , TOK_TEXT
}
 

Private Member Functions

token_t get_token (bool parsing_attributes)
 
char32_t getc ()
 
void load (node::pointer_t &root)
 Load the XML as node in root.
 
token_t read_tag_attributes (node::pointer_t &tag)
 
token_t skip_empty (token_t tok)
 
void unescape_entities ()
 
void ungetc (char32_t c)
 

Private Attributes

std::string f_filename = std::string()
 
std::istream & f_in
 
int f_line = 1
 
char32_t f_ungetc [4] = { '\0' }
 
std::size_t f_ungetc_pos = 0
 
std::string f_value = std::string()
 

Detailed Description

Definition at line 43 of file parser.h.

Member Enumeration Documentation

◆ token_t

enum class basic_xml::parser::token_t
strongprivate

Definition at line 49 of file parser.h.

Constructor & Destructor Documentation

◆ parser()

basic_xml::parser::parser ( std::string const &  filename,
std::istream &  in,
node::pointer_t &  root 
)

Definition at line 58 of file parser.cpp.

Member Function Documentation

◆ get_token()

parser::token_t basic_xml::parser::get_token ( bool  parsing_attributes)
private

Definition at line 269 of file parser.cpp.

◆ getc()

char32_t basic_xml::parser::getc ( )
private

Definition at line 749 of file parser.cpp.

◆ load()

void basic_xml::parser::load ( node::pointer_t &  root)
private

This function loads what it considers valid XML.

Parameters
[out]rootA reference to the root pointer where the results are saved.

Definition at line 75 of file parser.cpp.

◆ read_tag_attributes()

parser::token_t basic_xml::parser::read_tag_attributes ( node::pointer_t &  tag)
private

Definition at line 218 of file parser.cpp.

◆ skip_empty()

parser::token_t basic_xml::parser::skip_empty ( token_t  tok)
private

Definition at line 198 of file parser.cpp.

◆ unescape_entities()

void basic_xml::parser::unescape_entities ( )
private

Definition at line 645 of file parser.cpp.

◆ ungetc()

void basic_xml::parser::ungetc ( char32_t  c)
private

Definition at line 809 of file parser.cpp.

Member Data Documentation

◆ f_filename

std::string basic_xml::parser::f_filename = std::string()
private

Definition at line 71 of file parser.h.

◆ f_in

std::istream& basic_xml::parser::f_in
private

Definition at line 72 of file parser.h.

◆ f_line

int basic_xml::parser::f_line = 1
private

Definition at line 75 of file parser.h.

◆ f_ungetc

char32_t basic_xml::parser::f_ungetc[4] = { '\0' }
private

Definition at line 74 of file parser.h.

◆ f_ungetc_pos

std::size_t basic_xml::parser::f_ungetc_pos = 0
private

Definition at line 73 of file parser.h.

◆ f_value

std::string basic_xml::parser::f_value = std::string()
private

Definition at line 76 of file parser.h.


The documentation for this class was generated from the following files:

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.