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.hxx | |
parent | 5ced83875191cf9e0f395af79f45babd6fae3d29 (diff) |
Add support for schema version table
Diffstat (limited to 'odb/option-types.hxx')
-rw-r--r-- | odb/option-types.hxx | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/odb/option-types.hxx b/odb/option-types.hxx index 2f8825d..f078d3c 100644 --- a/odb/option-types.hxx +++ b/odb/option-types.hxx @@ -173,6 +173,78 @@ operator>> (std::istream&, name_case&); // // +struct pgsql_version +{ + pgsql_version (unsigned short major, unsigned short minor) + : major_ (major), minor_ (minor) + { + } + + unsigned short + ver_major () const + { + return major_; + } + + unsigned short + ver_minor () const + { + return minor_; + } + +private: + unsigned short major_; + unsigned short minor_; +}; + +inline bool +operator== (const pgsql_version& x, const pgsql_version& y) +{ + return x.ver_major () == y.ver_major (); +} + +inline bool +operator!= (const pgsql_version& x, const pgsql_version& y) +{ + return !(x == y); +} + +inline bool +operator< (const pgsql_version& x, const pgsql_version& y) +{ + return x.ver_major () < y.ver_major () || + (x.ver_major () == y.ver_major () && + x.ver_minor () < y.ver_minor ()); +} + +inline bool +operator> (const pgsql_version& x, const pgsql_version& y) +{ + return x.ver_major () > y.ver_major () || + (x.ver_major () == y.ver_major () && + x.ver_minor () > y.ver_minor ()); +} + +inline bool +operator<= (const pgsql_version& x, const pgsql_version& y) +{ + return !(x > y); +} + +inline bool +operator>= (const pgsql_version& x, const pgsql_version& y) +{ + return !(x < y); +} + +std::istream& +operator>> (std::istream&, pgsql_version&); + +std::ostream& +operator<< (std::ostream&, pgsql_version); + +// +// struct oracle_version { oracle_version (unsigned short major, unsigned short minor) |