diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-10-15 11:34:06 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-10-15 11:34:06 +0200 |
commit | fac1bf0b0db4aa90472a2dd06c646af145e059a5 (patch) | |
tree | 2d2ecc6e9a5dec300630baef29eb0ce6e42bb39e /libxsde/xsde/cxx/parser/context.hxx | |
parent | d6635604d7d684edcbd90b4423888b6bb9058dae (diff) |
Add current element to the parser context
Diffstat (limited to 'libxsde/xsde/cxx/parser/context.hxx')
-rw-r--r-- | libxsde/xsde/cxx/parser/context.hxx | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/libxsde/xsde/cxx/parser/context.hxx b/libxsde/xsde/cxx/parser/context.hxx index 9654e57..6019f34 100644 --- a/libxsde/xsde/cxx/parser/context.hxx +++ b/libxsde/xsde/cxx/parser/context.hxx @@ -12,6 +12,8 @@ #include <xsde/c/expat/expat.h> +#include <xsde/cxx/ro-string.hxx> + #ifndef XSDE_EXCEPTIONS # include <xsde/cxx/sys-error.hxx> #endif @@ -44,12 +46,24 @@ namespace xsde class context { public: - context (XML_Parser xml_parser); + context (); + + private: + context (const context&); + context& operator= (const context&); public: XML_Parser xml_parser (); + // Return namespace and name of the current element being parsed. + // + const ro_string& + element_namespace () const; + + const ro_string& + element_name () const; + // Error handling via codes. // public: @@ -125,10 +139,23 @@ namespace xsde #endif // XSDE_PARSER_VALIDATION || !XSDE_EXCEPTIONS public: + void + reset (XML_Parser); + + void + element_namespace (const ro_string&); + + void + element_name (const ro_string&); + + public: parser_state current_; protected: XML_Parser xml_parser_; + + ro_string ns_; + ro_string name_; }; } } |