|
ximol/parser/utils.cpp File Reference
#include <ximol/parser/utils.hpp>
#include <ximol/str_cast.hpp>
#include <ximol/parser/def_signs.hpp>
#include <ximol/encoders/encoders.hpp>
#include <ximol/translation.hpp>
#include <ximol/sstream.hpp>
#include <ximol/error.hpp>
#include <ximol/io.hpp>
Include dependency graph for utils.cpp:
Go to the source code of this file.
|
Classes |
class | codecvt_ximol_raw_data |
Defines |
#define | XBET(lower, upper) ( ((xchar_t)lower <= c) && (c <= (xchar_t)upper) ) |
#define | XEQ(val) ((xchar_t)val == c) |
Functions |
XIMOL_PARSER_BEGIN_NAMESPACE
void | write_xchar (xostream &xos, xchar_t xc) |
| Put a char in the stream Do not use this function.
|
template<class T> void | clear_string (T &xstr) |
xistream & | read_xchar (xistream &xis, xchar_t xc, const::std::wstring &error_msg) |
| read Special char.
|
xistream & | read_xchar (xistream &xis, xchar_t &xc, bool(*is_good_xchar)(xchar_t), const::std::wstring &error_msg) |
| read Char defined by a function.
|
xistream & | read_xstring (xistream &xis, xstring &xstr, bool(*is_good_xchar)(xchar_t), bool erase_string) |
| read string defined by a function.
|
bool | is_xstring (const xstring &xstr, bool(*is_good_xchar)(xchar_t)) |
| Test string defined by a function.
|
xistream & | read_xstring (xistream &xistream_, const::std::string &str_, const::std::wstring &strErrorMsg_, size_t size_) |
| read Special string.
|
xostream & | write_string_with_forbidden_serie (xostream &xos, const xstring &xstr, bool(*is_good_xchar)(xchar_t), const::std::string &forbidden_string, const::std::string &entity_test, const::std::string &entity_definition) |
xistream & | read_string_with_forbidden_serie (xistream &xis, xstring &xstr, bool(*is_good_xchar)(xchar_t), const::std::string &forbidden_string) |
bool | is_string_with_forbidden_serie (const xstring &xstr, bool(*is_good_xchar)(xchar_t), const::std::string &forbidden_string) |
bool | is_in_range (xchar_t c, xchar_t lower, xchar_t upper) |
bool | is_space (xchar_t c) |
bool | is_digit (xchar_t c) |
bool | is_char (xchar_t c) |
bool | is_letter (xchar_t c) |
bool | is_combining_char (xchar_t c) |
bool | is_base_char (xchar_t c) |
bool | is_ideographic (xchar_t c) |
bool | is_extender (xchar_t c) |
bool | is_name_char (xchar_t c) |
bool | IsNCNameChar (xchar_t c) |
bool | is_pubid_char (xchar_t c) |
xostream & | write_space (xostream &xos) |
xistream & | read_space (xistream &xis) |
xistream & | read_optionnal_space (xistream &xis) |
xostream & | write_name (xostream &xos, const xstring &xstr) |
bool | is_first_char_name (xchar_t xc) |
xistream & | read_name (xistream &xis, xstring &xstr) |
bool | is_name (const xstring &xstr) |
xostream & | write_ncname (xostream &xos, const xstring &xstr) |
bool | is_first_char_ncname (xchar_t xc) |
xistream & | read_ncname (xistream &xis, xstring &xstr) |
bool | is_ncname (const xstring &xstr) |
xostream & | write_qname (xostream &xos, const xstring &localPart, const xstring &prefix) |
xistream & | read_qname (xistream &xis, xstring &localPart, xstring &prefix) |
bool | is_qname (const xstring &localPart, const xstring &prefix) |
xostream & | write_ns_att_name (xostream &xos, const xstring &xstr) |
xistream & | read_ns_att_name (xistream &xis, xstring &xstr, int nb_read) |
bool | is_ns_att_name (const xstring &xstr) |
bool | IsNotAndOrInf (xchar_t xc) |
xostream & | write_char_data (xostream &xos, const xstring &xstr) |
xistream & | read_char_data (xistream &xis, xstring &xstr) |
bool | is_char_data (const xstring &xstr) |
xostream & | write_nm_token (xostream &xos, const xstring &xstr) |
xistream & | read_nm_token (xistream &xis, xstring &xstr) |
bool | is_nm_token (const xstring &xstr) |
xostream & | write_char_ref (xostream &xos, xchar_t xc) |
xistream & | read_char_ref (xistream &xis, xchar_t &xc_read, int nb_read) |
xstring | replace_char_ref (const xstring &xstr) |
xostream & | write_entity_ref (xostream &xos, const xstring &xstr) |
xistream & | read_entity_ref (xistream &xis, int nb_read) |
xostream & | write_pe_reference (xostream &xos, const xstring &xstr) |
xistream & | read_pe_reference (xistream &xis, xstring &xstr, int nb_read) |
xistream & | read_reference (xistream &xis, xstring &xstr, int nb_read) |
xostream & | write_pubid_literal (xostream &xos, const xstring &xstr) |
bool | IsQuote (xchar_t c) |
xistream & | read_pubid_literal (xistream &xis, xstring &xstr) |
xostream & | write_system_literal (xostream &xos, const xstring &xstr, xchar_t quote) |
xistream & | read_system_literal (xistream &xis, xstring &xstr) |
xostream & | write_entity_value (xostream &xos, const xstring &xstr, xchar_t quote) |
xstring | ToQuoteRef (const xstring &xstr) |
xistream & | read_entity_value (xistream &xis, xstring &xstr) |
xostream & | write_att_value (xostream &xos, const xstring &xstr, xchar_t quote) |
xistream & | read_att_value (xistream &xis, xstring &xstr) |
xostream & | write_attribute (xostream &xos, const xstring &name, const xstring &att_value, const xstring &short_ns, xchar_t quote) |
xistream & | read_attribute (xistream &xis, xstring &name, xstring &att_value, xstring &short_ns) |
bool | is_comment (const xstring &xstr) |
xostream & | write_comment (xostream &xos, const xstring &xstr) |
xistream & | read_comment (xistream &xis, xstring &xstr, int nb_read) |
xistream & | read_comment (xistream &xis, int nb_read) |
bool | is_pi_target (const xstring &xstr) |
xostream & | write_pi_target (xostream &xos, const xstring &xstr) |
xistream & | read_pi_target (xistream &xis, xstring &xstr) |
xostream & | write_pi (xostream &xos, const xstring &pi_target, const xstring &xext) |
xistream & | read_pi (xistream &xis, xstring &xstr, xstring &xext, int nb_read) |
xistream & | read_pi (xistream &xis, int nb_read) |
xostream & | write_cd_end (xostream &xos) |
xistream & | read_cd_end (xistream &xis, int nb_read) |
xostream & | write_cd_start (xostream &xos) |
xistream & | read_cd_start (xistream &xis, int nb_read) |
xostream & | write_cdata (xostream &xos, const xstring &xstr) |
xistream & | read_cdata (xistream &xis, xstring &xstr) |
xostream & | write_cd_sect (xostream &xos, const xstring &xstr) |
xistream & | read_cd_sect (xistream &xis, xstring &xstr, int nb_char) |
xostream & | write_eq (xostream &xos) |
xistream & | read_eq (xistream &xis) |
bool | IsVersionNumChar (xchar_t c) |
bool | is_version_num (const xstring &xstr) |
xostream & | write_version_num (xostream &xos, const xstring &xstr) |
xistream & | read_version_num (xistream &xis, xstring &xstr) |
xostream & | write_version_info (xostream &xos, const xstring &xstr) |
xistream & | read_version_info (xistream &xis, xstring &xstr, bool read_first_space) |
xistream & | read_version_info (xistream &xis, bool read_first_space) |
bool | IsFirstEncNameChar (xchar_t c) |
bool | IsSecondEncNameChar (xchar_t c) |
bool | is_enc_name (const xstring &xstr) |
xostream & | write_enc_name (xostream &xos, const xstring &xstr) |
xistream & | read_enc_name (xistream &xis, xstring &xstr) |
xostream & | write_encoding_decl (xostream &xos, const xstring &xstr) |
xistream & | read_encoding_decl (xistream &xis, xstring &xstr, bool read_first_space) |
xostream & | write_sd_decl (xostream &xos, bool standalone) |
xistream & | read_sd_decl (xistream &xis, bool &standalone, bool read_first_space) |
xostream & | write_xml_decl (xostream &xos, const xstring &version_info, const xstring &encoding_decl, const xstring &standalone_decl) |
xostream & | write_xml_decl (xostream &xos) |
bool | IsCharESQ (xchar_t c) |
bool | IsCharSQ (xchar_t c) |
xistream & | read_xml_decl (xistream &xis, xstring &version_info, xstring &encoding_decl, bool &standalone_decl, int nb_read) |
xistream & | read_xml_decl (xistream &xis, int nb_read) |
xostream & | write_external_id (xostream &xos, const xstring &system_literal, const xstring &pub_id_literal) |
bool | IsExternalCharSP (xchar_t c) |
xistream & | read_external_id (xistream &xis, xstring &system_literal, xstring &pub_id_literal) |
xostream & | write_public_id (xostream &xos, const xstring &pub_id_literal) |
xistream & | read_public_id (xistream &xis, xstring &pub_id_literal) |
xostream & | write_notation_decl (xostream &xos, const xstring &name, const xstring &system_literal, const xstring &pub_id_literal) |
xistream & | read_notation_decl (xistream &xis, xstring &name, xstring &system_literal, xstring &pub_id_literal, int nb_read) |
xistream & | read_notation_decl (xistream &xis, int nb_read) |
xostream & | write_open_stag (xostream &xos, const xstring &name, const XIMOL_XML_NAMESPACE_PATH::attributes &att, const xstring &uri) |
xostream & | write_open_stag (xostream &xos, const xstring &name, const xstring &uri) |
xostream & | write_stag (xostream &xos, const xstring &name, const XIMOL_XML_NAMESPACE_PATH::attributes &att, const xstring &uri) |
xostream & | write_stag (xostream &xos, const xstring &name) |
xostream & | write_stag (xostream &xos, const xstring &name, const xstring &uri) |
xistream & | read_open_stag (xistream &xis, xstring &name, XIMOL_XML_NAMESPACE_PATH::attributes &att, xstring &uri, int nb_read) |
xistream & | read_open_stag (xistream &xis, xstring &name, xstring &uri, int nb_read) |
xistream & | read_open_stag (xistream &xis, xstring &name, int nb_read) |
xistream & | read_stag (xistream &xis, xstring &name, XIMOL_XML_NAMESPACE_PATH::attributes &att, xstring &uri, int nb_read) |
xistream & | read_stag (xistream &xis, xstring &name, xstring &uri, int nb_read) |
xistream & | read_stag (xistream &xis, xstring &name, XIMOL_XML_NAMESPACE_PATH::attributes &att, int nb_read) |
xistream & | read_stag (xistream &xis, xstring &name, int nb_read) |
xostream & | write_etag (xostream &xos, const xstring &name) |
xostream & | write_etag (xostream &xos, const xstring &name, const xstring &uri) |
xostream & | write_etag (xostream &xos) |
xistream & | read_etag (xistream &xis, xstring &name, xstring &uri, int nb_read) |
xistream & | read_etag (xistream &xis, xstring &name, int nb_read) |
xistream & | read_etag (xistream &xis, int nb_read) |
xostream & | write_pe_def (xostream &xos, const xstring &entity_value, const xstring &system_literal, const xstring &pub_id_literal) |
xistream & | read_pe_def (xistream &xis, xstring &entity_value, xstring &system_literal, xstring &pub_id_literal) |
xostream & | write_ndata_decl (xostream &xos, const xstring &name) |
xistream & | read_ndata_decl (xistream &xis, xstring &name, int nb_read) |
xostream & | write_entity_def (xostream &xos, const xstring &entity_value, const xstring &system_literal, const xstring &pub_id_literal, const xstring &ndata_name) |
xistream & | read_entity_def (xistream &xis, xstring &entity_value, xstring &system_literal, xstring &pub_id_literal, xstring &ndata_name) |
xostream & | write_pe_decl (xostream &xos, const xstring &entity_name, const xstring &entity_value, const xstring &system_literal, const xstring &pubid_literal) |
xistream & | read_pe_decl (xistream &xis, xstring &entity_name, xstring &entity_value, xstring &system_literal, xstring &pubid_literal, int nb_read) |
xistream & | read_pe_decl (xistream &xis, int nb_read) |
xostream & | write_ge_decl (xostream &xos, const xstring &entity_name, const xstring &entity_value, const xstring &system_literal, const xstring &pubid_literal, const xstring &ndata_name) |
xistream & | read_ge_decl (xistream &xis, xstring &entity_name, xstring &entity_value, xstring &system_literal, xstring &pubid_literal, xstring &ndata_name, int nb_read) |
xistream & | read_ge_decl (xistream &xis, int nb_read) |
xistream & | read_misc (xistream &xis) |
xostream & | write_prolog (xostream &xos) |
void | BeforeBOM (xistream &xis) |
void | AfterBOM (xistream &xis) |
size_t | read_bom (xistream &xis) |
xistream & | read_prolog_question (xistream &xis, int nb_read) |
| read a prolog question tag
|
xistream & | read_doctype_decl (xistream &xis, int nb_read) |
xistream & | read_prolog_exclamation (xistream &xis, int nb_read) |
| read a prolog exclamation tag
|
xistream & | read_doctype_element (xistream &xis, int nb_read) |
| read doctype elements
|
xistream & | read_prolog (xistream &xis) |
xistream & | read_element_decl (xistream &xis, int nb_read) |
xistream & | read_att_list_decl (xistream &xis, int nb_read) |
xistream & | read_entity_decl (xistream &xis, int nb_read) |
Define Documentation
#define XBET |
( |
lower, |
|
|
upper |
|
) |
( ((xchar_t)lower <= c) && (c <= (xchar_t)upper) )
|
|
|
Definition at line 120 of file utils.cpp.
Referenced by is_base_char(), is_char(), is_combining_char(), is_digit(), is_extender(), is_ideographic(), is_in_range(), is_pubid_char(), IsFirstEncNameChar(), IsSecondEncNameChar(), and IsVersionNumChar(). |
#define XEQ |
( |
val |
|
) |
((xchar_t)val == c)
|
|
|
Definition at line 121 of file utils.cpp.
Referenced by is_base_char(), is_char(), is_combining_char(), is_extender(), is_ideographic(), is_name_char(), is_pubid_char(), is_space(), IsCharESQ(), IsCharSQ(), IsExternalCharSP(), IsNCNameChar(), IsQuote(), IsSecondEncNameChar(), and IsVersionNumChar(). |
Function Documentation
template<class T> |
void clear_string |
( |
T & |
xstr |
) |
|
|
bool is_string_with_forbidden_serie |
( |
const xstring & |
xstr, |
|
|
bool(* |
is_good_xchar)(xchar_t), |
|
|
const::std::string & |
forbidden_string |
|
) |
|
|
bool IsExternalCharSP |
( |
xchar_t |
c |
) |
|
|
bool IsFirstEncNameChar |
( |
xchar_t |
c |
) |
|
|
bool IsSecondEncNameChar |
( |
xchar_t |
c |
) |
|
|
bool IsVersionNumChar |
( |
xchar_t |
c |
) |
|
|
|
read doctype elements
Definition at line 3460 of file utils.cpp.
References _(), xistream::front(), xistream::get(), xistream::pop_front(), read_att_list_decl(), read_comment(), read_element_decl(), read_entity_decl(), read_notation_decl(), read_xchar(), XCHAR_EXCLAMATION_MARK, XCHAR_HYPHEN_MINUS, XCHAR_LATIN_CAPITAL_LETTER_A, XCHAR_LATIN_CAPITAL_LETTER_E, XCHAR_LATIN_CAPITAL_LETTER_L, XCHAR_LATIN_CAPITAL_LETTER_N, XCHAR_LESS_THAN_SIGN, xchar_t, XIMOL_AS_ERROR, and XIMOL_THROW.
Referenced by read_doctype_decl(). |
XIMOL_PARSER_BEGIN_NAMESPACE void write_xchar |
( |
xostream & |
xos, |
|
|
xchar_t |
xc |
|
) |
|
|
|
Put a char in the stream Do not use this function.
- Parameters:
-
xos | : the output stream |
xc | : the charater |
Definition at line 129 of file utils.cpp.
Referenced by operator<<(), write_att_value(), write_cd_end(), write_cd_start(), write_char_ref(), write_comment(), write_encoding_decl(), write_entity_ref(), write_entity_value(), write_eq(), write_etag(), write_ge_decl(), write_ndata_decl(), write_notation_decl(), write_ns_att_name(), write_pe_decl(), write_pe_reference(), write_pi(), write_pubid_literal(), write_qname(), write_sd_decl(), write_space(), write_stag(), write_system_literal(), and write_version_info(). |
|
|