context Class Reference
[Parser]

#include <context.hpp>

Collaboration diagram for context:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class contain all information about reding and write XML. Entity and parameter entity are saved in this class.

Author:
Tournois Florent.
Todo:
this class must be commented.

Definition at line 78 of file context.hpp.

Public Types

typedef XIMOL_EXPORT::std::map<
xstring, xstring > 
map_type
typedef XIMOL_EXPORT::std::map<
xstring, entity_def_type > 
entity_def_map_type
typedef XIMOL_EXPORT::std::map<
xstring, pe_def_type > 
pe_def_map_type
typedef XIMOL_EXPORT::std::map<
xstring, notation_decl_type > 
notation_decl_map_type
typedef XIMOL_EXPORT::std::list<
level > 
levels_type
typedef XIMOL_EXPORT::std::map<
xstring, void * > 
key_map_type

Public Member Functions

 context ()
add functions
bool add_entity (const xstring &entity_name, const xstring &entity_value, const xstring &system_literal=L"", const xstring &pubid_literal=L"", const xstring &ndata_name=L"")
bool add_paramter_entity (const xstring &entity_name, const xstring &entity_value, const xstring &system_literal=L"", const xstring &pubid_literal=L"")
bool add_notation_decl (const xstring &name, const xstring &system_literal, const xstring &pubid_literal)
bool add_processing_instruction (const xstring &pi_target, const xstring &value)
Get functions
const xstring & get_entity (const xstring &entity_name) const
const xstring & get_parameter_entity (const xstring &entity_name) const
const notation_decl_type & get_notation_decl (const xstring &name) const
const xstring & get_processing_instruction (const xstring &pi_target) const
const xstring & get_version_num () const
bool get_sd_decl () const
const xstring & get_encoding_decl () const
Set functions
void set_version_num (const xstring &ver)
void set_sd_decl (bool sddecl)
void set_encoding_decl (const xstring &encoding_name)
level functions
context & add_new_level (const xstring &uri, const xstring &tag, const XIMOL_XML_NAMESPACE_PATH::attributes &att, bool open_start=false, bool open_end=false)
context & destroy_level ()
bool is_open_stag () const
bool is_open_etag () const
context & close_open_stag ()
context & close_open_etag ()
context & set_open_stag ()
context & set_open_etag ()
const xstring & get_level_tag () const
const xstring & get_level_ns_tag () const
const xstring & get_level_short_ns_tag () const
const XIMOL_XML_NAMESPACE_PATH::attributes & get_level_attributes () const
XIMOL_XML_NAMESPACE_PATH::attributes get_attributes () const
int get_depth () const
context & add_level_attributes (const XIMOL_XML_NAMESPACE_PATH::attributes &att)
const xstring & get_namespace (const xstring &short_ns) const
const xstring & get_short_namespace (const xstring &uri) const
const xstring & get_default_namespace () const
doctype functions.
const xstring & get_doc_type_name () const
void set_doc_type_name (const xstring &name)
const notation_decl_type & get_doctype_external_id () const
void set_doctype_external_id (const xstring &system_literal, const xstring &pubid_literal)
keyType functions.
template<class T> bool set_id (const xstring &key, T *t)
template<class T> bool get_id (const xstring &key, T *t)


Member Typedef Documentation

typedef class XIMOL_EXPORT::std::map< xstring, entity_def_type > context::entity_def_map_type
 

Definition at line 117 of file context.hpp.

typedef class XIMOL_EXPORT::std::map< xstring, void * > context::key_map_type
 

Definition at line 121 of file context.hpp.

typedef class XIMOL_EXPORT::std::list< level > context::levels_type
 

Definition at line 120 of file context.hpp.

typedef class XIMOL_EXPORT::std::map< xstring, xstring > context::map_type
 

Definition at line 116 of file context.hpp.

typedef class XIMOL_EXPORT::std::map< xstring, notation_decl_type > context::notation_decl_map_type
 

Definition at line 119 of file context.hpp.

typedef class XIMOL_EXPORT::std::map< xstring, pe_def_type > context::pe_def_map_type
 

Definition at line 118 of file context.hpp.


Constructor & Destructor Documentation

context::context (   ) 
 

<!ENTITY lt "&#38;#60;"> <!ENTITY gt "&#62;"> <!ENTITY amp "&#38;#38;"> <!ENTITY apos "&#39;"> <!ENTITY quot "&#34;">

Definition at line 95 of file context.cpp.

References add_entity(), and XIMOL_DEFAULT_ENCODING.


Member Function Documentation

bool context::add_entity (  const xstring &  entity_name,
const xstring &  entity_value,
const xstring &  system_literal = L"",
const xstring &  pubid_literal = L"",
const xstring &  ndata_name = L""
) 
 

Definition at line 115 of file context.cpp.

References clear_string(), context::entity_def_type::entity_value, context::entity_def_type::name_, context::entity_def_type::pubid_literal_, context::entity_def_type::system_literal_, and xstring.

Referenced by context().

context & context::add_level_attributes (  const XIMOL_XML_NAMESPACE_PATH::attributes &  att  ) 
 

Definition at line 438 of file context.cpp.

References get_depth().

context & context::add_new_level (  const xstring &  uri,
const xstring &  tag,
const XIMOL_XML_NAMESPACE_PATH::attributes &  att,
bool  open_start = false,
bool  open_end = false
) 
 

Definition at line 269 of file context.cpp.

References context::level::att_, get_namespace(), context::level::is_open_etag, context::level::is_open_stag, context::level::tag_, context::level::uri_tag_, and xstring.

bool context::add_notation_decl (  const xstring &  name,
const xstring &  system_literal,
const xstring &  pubid_literal
) 
 

Definition at line 157 of file context.cpp.

References context::notation_decl_type::pubid_literal_, context::notation_decl_type::system_literal_, and xstring.

bool context::add_paramter_entity (  const xstring &  entity_name,
const xstring &  entity_value,
const xstring &  system_literal = L"",
const xstring &  pubid_literal = L""
) 
 

Definition at line 137 of file context.cpp.

References clear_string(), context::pe_def_type::entity_value, context::pe_def_type::pubid_literal_, context::pe_def_type::system_literal_, and xstring.

bool context::add_processing_instruction (  const xstring &  pi_target,
const xstring &  value
) 
 

Definition at line 169 of file context.cpp.

References xstring.

context & context::close_open_etag (   ) 
 

Definition at line 343 of file context.cpp.

References get_depth().

context & context::close_open_stag (   ) 
 

Definition at line 333 of file context.cpp.

References get_depth().

context & context::destroy_level (   ) 
 

Definition at line 303 of file context.cpp.

References get_depth().

XIMOL_XML_NAMESPACE_PATH::attributes context::get_attributes (   )  const
 

Definition at line 417 of file context.cpp.

const xstring & context::get_default_namespace (   )  const
 

Definition at line 488 of file context.cpp.

References xstring.

int context::get_depth (   )  const
 

Definition at line 429 of file context.cpp.

Referenced by add_level_attributes(), close_open_etag(), close_open_stag(), destroy_level(), get_level_attributes(), get_level_ns_tag(), get_level_short_ns_tag(), get_level_tag(), is_open_etag(), is_open_stag(), set_open_etag(), and set_open_stag().

const xstring & context::get_doc_type_name (   )  const
 

Definition at line 506 of file context.cpp.

References xstring.

const context::notation_decl_type & context::get_doctype_external_id (   )  const
 

Definition at line 522 of file context.cpp.

const xstring & context::get_encoding_decl (   )  const
 

Definition at line 237 of file context.cpp.

References xstring.

const xstring & context::get_entity (  const xstring &  entity_name  )  const
 

Definition at line 191 of file context.cpp.

References xstring.

template<class T>
bool context::get_id (  const xstring &  key,
T *  t
)  [inline]
 

Definition at line 203 of file context.hpp.

References xstring.

const XIMOL_XML_NAMESPACE_PATH::attributes & context::get_level_attributes (   )  const
 

Definition at line 406 of file context.cpp.

References get_depth(), XIMOL_AS_ERROR, and XIMOL_THROW.

const xstring & context::get_level_ns_tag (   )  const
 

Definition at line 395 of file context.cpp.

References _(), get_depth(), XIMOL_AS_ERROR, XIMOL_THROW, and xstring.

const xstring & context::get_level_short_ns_tag (   )  const
 

Definition at line 384 of file context.cpp.

References _(), get_depth(), get_short_namespace(), XIMOL_AS_ERROR, XIMOL_THROW, and xstring.

const xstring & context::get_level_tag (   )  const
 

Definition at line 373 of file context.cpp.

References _(), get_depth(), XIMOL_AS_ERROR, XIMOL_THROW, and xstring.

const xstring & context::get_namespace (  const xstring &  short_ns  )  const
 

Definition at line 448 of file context.cpp.

References xstring.

Referenced by add_new_level().

const context::notation_decl_type & context::get_notation_decl (  const xstring &  name  )  const
 

Definition at line 178 of file context.cpp.

References xstring.

const xstring & context::get_parameter_entity (  const xstring &  entity_name  )  const
 

Definition at line 201 of file context.cpp.

References xstring.

const xstring & context::get_processing_instruction (  const xstring &  pi_target  )  const
 

Definition at line 211 of file context.cpp.

References xstring.

bool context::get_sd_decl (   )  const
 

Definition at line 229 of file context.cpp.

const xstring & context::get_short_namespace (  const xstring &  uri  )  const
 

Definition at line 466 of file context.cpp.

References xstring.

Referenced by get_level_short_ns_tag().

const xstring & context::get_version_num (   )  const
 

Definition at line 221 of file context.cpp.

References xstring.

bool context::is_open_etag (   )  const
 

Definition at line 323 of file context.cpp.

References get_depth().

bool context::is_open_stag (   )  const
 

Definition at line 313 of file context.cpp.

References get_depth().

void context::set_doc_type_name (  const xstring &  name  ) 
 

Definition at line 514 of file context.cpp.

References xstring.

void context::set_doctype_external_id (  const xstring &  system_literal,
const xstring &  pubid_literal
) 
 

Definition at line 530 of file context.cpp.

References context::notation_decl_type::pubid_literal_, context::notation_decl_type::system_literal_, and xstring.

void context::set_encoding_decl (  const xstring &  encoding_name  ) 
 

Definition at line 261 of file context.cpp.

References xstring.

template<class T>
bool context::set_id (  const xstring &  key,
T *  t
)  [inline]
 

Definition at line 195 of file context.hpp.

context & context::set_open_etag (   ) 
 

Definition at line 363 of file context.cpp.

References get_depth().

context & context::set_open_stag (   ) 
 

Definition at line 353 of file context.cpp.

References get_depth().

void context::set_sd_decl (  bool  sddecl  ) 
 

Definition at line 253 of file context.cpp.

void context::set_version_num (  const xstring &  ver  ) 
 

Definition at line 245 of file context.cpp.

References xstring.


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


Donate to the XiMoL project SourceForge.net Logo If you have any questions about XiMoL, you could write to tournois@users.sourceforge.net.