diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-04-25 07:35:45 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-04-25 07:35:45 +0200 |
commit | 8554cd89897f9cbd1705592cf0318b3ef4e42665 (patch) | |
tree | a81469bcddd6bddd2eb89c12faa9c59169484b43 /odb/option-types.cxx | |
parent | 5ced83875191cf9e0f395af79f45babd6fae3d29 (diff) |
Add support for schema version table
Diffstat (limited to 'odb/option-types.cxx')
-rw-r--r-- | odb/option-types.cxx | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/odb/option-types.cxx b/odb/option-types.cxx index 841c513..405a512 100644 --- a/odb/option-types.cxx +++ b/odb/option-types.cxx @@ -218,6 +218,48 @@ operator>> (istream& is, name_case& v) } // +// pgsql_version +// + +istream& +operator>> (istream& is, pgsql_version& v) +{ + unsigned short major, minor; + + // Extract the major version. + // + is >> major; + + if (!is.fail ()) + { + // Extract the decimal point. + // + char p; + is >> p; + + if (!is.fail () && p == '.') + { + // Extract the minor version. + // + is >> minor; + + if (!is.fail ()) + v = pgsql_version (major, minor); + } + else + is.setstate (istream::failbit); + } + + return is; +} + +ostream& +operator<< (ostream& os, pgsql_version v) +{ + return os << v.ver_major () << '.' << v.ver_minor (); +} + +// // oracle_version // |