aboutsummaryrefslogtreecommitdiff
path: root/butl/standard-version.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-04-28 10:43:50 +0200
committerKaren Arutyunov <karen@codesynthesis.com>2017-04-28 12:08:14 +0300
commit9175323db2ac6fabb15a5bebb0679c39150437bb (patch)
tree2eab1a7c953a68251b7940857da2a9e0ecdcffbc /butl/standard-version.cxx
parentae4dea0483145ec6e57a818907d3f007875a6009 (diff)
Add standard_version::string_project_id()
Diffstat (limited to 'butl/standard-version.cxx')
-rw-r--r--butl/standard-version.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/butl/standard-version.cxx b/butl/standard-version.cxx
index 3e049e2..1952653 100644
--- a/butl/standard-version.cxx
+++ b/butl/standard-version.cxx
@@ -332,6 +332,21 @@ namespace butl
}
string standard_version::
+ string_project_id () const
+ {
+ std::string r (string_version ());
+
+ if (snapshot ()) // Trailing dot already in id.
+ {
+ r += (snapshot_sn == latest_sn ? "z" :
+ snapshot_id.empty () ? to_string (snapshot_sn) :
+ snapshot_id);
+ }
+
+ return r;
+ }
+
+ string standard_version::
string () const
{
std::string r;