aboutsummaryrefslogtreecommitdiff
path: root/xml/parser.ixx
diff options
context:
space:
mode:
Diffstat (limited to 'xml/parser.ixx')
-rw-r--r--xml/parser.ixx29
1 files changed, 29 insertions, 0 deletions
diff --git a/xml/parser.ixx b/xml/parser.ixx
index ac27b46..9041b0c 100644
--- a/xml/parser.ixx
+++ b/xml/parser.ixx
@@ -2,10 +2,33 @@
// copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC
// license : MIT; see accompanying LICENSE file
+#include <cassert>
+
#include <xml/value-traits.hxx>
namespace xml
{
+ inline parser::
+ parser (std::istream& is, const std::string& iname, feature_type f)
+ : size_ (0), iname_ (iname), feature_ (f)
+ {
+ data_.is = &is;
+ init ();
+ }
+
+ inline parser::
+ parser (const void* data,
+ std::size_t size,
+ const std::string& iname,
+ feature_type f)
+ : size_ (size), iname_ (iname), feature_ (f)
+ {
+ assert (data != 0 && size != 0);
+
+ data_.buf = data;
+ init ();
+ }
+
template <typename T>
inline T parser::
value () const
@@ -75,4 +98,10 @@ namespace xml
{
return next_expect (e, std::string (), n);
}
+
+ inline const parser::element_entry* parser::
+ get_element () const
+ {
+ return element_state_.empty () ? 0 : get_element_ ();
+ }
}