aboutsummaryrefslogtreecommitdiff
path: root/libxsd/xsd/cxx/tree
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-04-10 12:57:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-04-10 12:57:06 +0200
commit884dea7531962b17ef843ac2175faa050e8b0758 (patch)
treed70950ab2a6f314b06f37faa67252678ce3007b1 /libxsd/xsd/cxx/tree
parent0f6ff689dc6bae8fed94da0fcabd39f015e7a62b (diff)
Add support for ordered types, mixed content
Diffstat (limited to 'libxsd/xsd/cxx/tree')
-rw-r--r--libxsd/xsd/cxx/tree/elements.hxx40
-rw-r--r--libxsd/xsd/cxx/tree/elements.ixx21
2 files changed, 60 insertions, 1 deletions
diff --git a/libxsd/xsd/cxx/tree/elements.hxx b/libxsd/xsd/cxx/tree/elements.hxx
index 6270c40..89be61e 100644
--- a/libxsd/xsd/cxx/tree/elements.hxx
+++ b/libxsd/xsd/cxx/tree/elements.hxx
@@ -21,6 +21,7 @@
#include <map>
#include <string>
#include <memory> // std::auto_ptr/unique_ptr
+#include <cstddef> // std::size_t
#include <istream>
#include <sstream>
#include <cassert>
@@ -190,7 +191,6 @@ namespace xsd
unsigned long x_;
};
-
// Parsing properties. Refer to xsd/cxx/xml/elements.hxx for XML-
// related properties.
//
@@ -199,6 +199,44 @@ namespace xsd
{
};
+ /**
+ * @brief Content order sequence entry.
+ *
+ * @nosubgrouping
+ */
+ struct content_order
+ {
+ /**
+ * @brief Initialize an instance with passed id and index.
+ *
+ * @param id Content id.
+ * @param index Content index in the corresponding sequence.
+ */
+ content_order (std::size_t id, std::size_t index = 0)
+ : id (id), index (index)
+ {
+ }
+
+ /**
+ * @brief Content id.
+ */
+ std::size_t id;
+
+ /**
+ * @brief Content index.
+ */
+ std::size_t index;
+ };
+
+ bool
+ operator== (const content_order&, const content_order&);
+
+ bool
+ operator!= (const content_order&, const content_order&);
+
+ bool
+ operator< (const content_order&, const content_order&);
+
//@cond
// DOM user data keys.
diff --git a/libxsd/xsd/cxx/tree/elements.ixx b/libxsd/xsd/cxx/tree/elements.ixx
index 1098299..da8a83e 100644
--- a/libxsd/xsd/cxx/tree/elements.ixx
+++ b/libxsd/xsd/cxx/tree/elements.ixx
@@ -8,6 +8,27 @@ namespace xsd
{
namespace tree
{
+ // content_order_type
+ //
+
+ inline bool
+ operator== (const content_order& x, const content_order& y)
+ {
+ return x.id == y.id && x.index == y.index;
+ }
+
+ inline bool
+ operator!= (const content_order& x, const content_order& y)
+ {
+ return !(x == y);
+ }
+
+ inline bool
+ operator< (const content_order& x, const content_order& y)
+ {
+ return x.id < y.id || (x.id == y.id && x.index < y.index);
+ }
+
// type
//