summaryrefslogtreecommitdiff
path: root/odb/option-types.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/option-types.cxx')
-rw-r--r--odb/option-types.cxx35
1 files changed, 35 insertions, 0 deletions
diff --git a/odb/option-types.cxx b/odb/option-types.cxx
index cfe1f06..3bbe72e 100644
--- a/odb/option-types.cxx
+++ b/odb/option-types.cxx
@@ -12,6 +12,41 @@
using namespace std;
//
+// cxx_version
+//
+
+static const char* cxx_version_[] =
+{
+ "c++98",
+ "c++11"
+};
+
+const char* cxx_version::
+string () const
+{
+ return cxx_version_[v_];
+}
+
+istream&
+operator>> (istream& is, cxx_version& v)
+{
+ string s;
+ is >> s;
+
+ if (!is.fail ())
+ {
+ if (s == "c++98")
+ v = cxx_version::cxx98;
+ else if (s == "c++11")
+ v = cxx_version::cxx11;
+ else
+ is.setstate (istream::failbit);
+ }
+
+ return is;
+}
+
+//
// database
//