From 7e4c92e29954c14f9c1dd51aff95fff25d3ced32 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 22 May 2019 14:15:44 +0300 Subject: Add support for package manifest upstream-version value --- mod/page.hxx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'mod/page.hxx') diff --git a/mod/page.hxx b/mod/page.hxx index 7260031..28257c1 100644 --- a/mod/page.hxx +++ b/mod/page.hxx @@ -129,7 +129,11 @@ namespace brep const string& v, const string& p = string (), bool a = false) - : label_ (l), name_ (n), value_ (v), placeholder_ (p), autofocus_ (a) + : label_ (l), + name_ (n), + value_ (v), + placeholder_ (!p.empty () ? &p : nullptr), + autofocus_ (a) { } @@ -140,7 +144,7 @@ namespace brep const string& label_; const string& name_; const string& value_; - const string& placeholder_; + const string* placeholder_; bool autofocus_; }; @@ -222,9 +226,11 @@ namespace brep TR_VERSION (const package_name& p, const version& v, const dir_path& r, - const string& t) + const string& t, + const optional& u = nullopt) : package_ (&p), version_ (v.string ()), + upstream_version_ (u ? &*u : nullptr), stub_ (v.compare (wildcard_version, true) == 0), root_ (&r), tenant_ (&t) @@ -233,9 +239,10 @@ namespace brep // Display the version as a regular text. // - TR_VERSION (const version& v) + TR_VERSION (const version& v, const optional& u = nullopt) : package_ (nullptr), version_ (v.string ()), + upstream_version_ (u ? &*u : nullptr), stub_ (v.compare (wildcard_version, true) == 0), root_ (nullptr), tenant_ (nullptr) @@ -248,6 +255,7 @@ namespace brep private: const package_name* package_; string version_; + const string* upstream_version_; bool stub_; const dir_path* root_; const string* tenant_; -- cgit v1.1