summaryrefslogtreecommitdiff
path: root/libxsd/xsd/cxx/tree/facet.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-09-17 07:15:29 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-09-17 07:15:29 +0200
commitf0510d2f90467de8e8f260b47d79a9baaf9bef17 (patch)
tree0b9929946f06a9cbe9b9e8f2a7600dae4e048f79 /libxsd/xsd/cxx/tree/facet.hxx
Start tracking XSD with git
Diffstat (limited to 'libxsd/xsd/cxx/tree/facet.hxx')
-rw-r--r--libxsd/xsd/cxx/tree/facet.hxx43
1 files changed, 43 insertions, 0 deletions
diff --git a/libxsd/xsd/cxx/tree/facet.hxx b/libxsd/xsd/cxx/tree/facet.hxx
new file mode 100644
index 0000000..e8f585b
--- /dev/null
+++ b/libxsd/xsd/cxx/tree/facet.hxx
@@ -0,0 +1,43 @@
+// file : xsd/cxx/tree/facet.hxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC
+// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+#ifndef XSD_CXX_TREE_FACET_HXX
+#define XSD_CXX_TREE_FACET_HXX
+
+namespace xsd
+{
+ namespace cxx
+ {
+ namespace tree
+ {
+ // We need to keep this type POD in order to be able to create a
+ // static array.
+ //
+ struct facet
+ {
+ enum id_type
+ {
+ none,
+ total_digits,
+ fraction_digits
+ };
+
+ id_type id;
+ unsigned long value;
+
+ static const facet*
+ find (const facet* facets, facet::id_type id)
+ {
+ while (facets->id != id && facets->id != none)
+ ++facets;
+
+ return facets->id != none ? facets : 0;
+ }
+ };
+ }
+ }
+}
+
+#endif // XSD_CXX_TREE_FACET_HXX