diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2018-05-04 23:42:51 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-05-05 16:02:10 +0300 |
commit | 166c3167bc608a63e2312930a9b722f8d697d2c5 (patch) | |
tree | 086b2b42f34414b45919ea1a7bf42ffb18f887d8 /libbutl/standard-version.mxx | |
parent | b5b66e6a831cf68b7da764235f669fad758491fb (diff) |
Add support for standard version constraint shortcut operators
Diffstat (limited to 'libbutl/standard-version.mxx')
-rw-r--r-- | libbutl/standard-version.mxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libbutl/standard-version.mxx b/libbutl/standard-version.mxx index b161063..fa74e01 100644 --- a/libbutl/standard-version.mxx +++ b/libbutl/standard-version.mxx @@ -157,12 +157,14 @@ LIBBUTL_MODEXPORT namespace butl // Create empty version. // standard_version () {} // = default; @@ MOD VC - - private: - void - parse_snapshot (const std::string&, std::size_t&); }; + // Try to parse a string as a standard version returning nullopt if invalid. + // + LIBBUTL_SYMEXPORT optional<standard_version> + parse_standard_version (const std::string&, + standard_version::flags = standard_version::none); + inline bool operator< (const standard_version& x, const standard_version& y) noexcept { @@ -220,6 +222,7 @@ LIBBUTL_MODEXPORT namespace butl // The build2 "standard version" constraint: // // ('==' | '>' | '<' | '>=' | '<=') <version> + // ('^' | '~') <version> // ('(' | '[') <version> <version> (')' | ']') // struct LIBBUTL_SYMEXPORT standard_version_constraint |