aboutsummaryrefslogtreecommitdiff
path: root/mod/page.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-05-22 14:15:44 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-05-22 16:40:04 +0300
commit7e4c92e29954c14f9c1dd51aff95fff25d3ced32 (patch)
tree2434a56ce3ebc84bbaca5267b5afecda8a523fba /mod/page.hxx
parentaae2024a1bdce3ffcb9e638d4a949a71ecdef4c0 (diff)
Add support for package manifest upstream-version value
Diffstat (limited to 'mod/page.hxx')
-rw-r--r--mod/page.hxx16
1 files changed, 12 insertions, 4 deletions
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<string>& 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<string>& 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_;