aboutsummaryrefslogtreecommitdiff
path: root/libbrep/common.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-03-15 18:51:06 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-03-15 18:51:06 +0300
commit3214778ed8efc7a72ab40823e826ac2c64cfbfb3 (patch)
treed1eda04b63e02fcc2140aac502b9c6feabae5eed /libbrep/common.hxx
parent67194c06c57ea32ecb70e8b97bc7037ac0e80751 (diff)
Add support for version iteration
Diffstat (limited to 'libbrep/common.hxx')
-rw-r--r--libbrep/common.hxx22
1 files changed, 12 insertions, 10 deletions
diff --git a/libbrep/common.hxx b/libbrep/common.hxx
index ea74756..0172ba2 100644
--- a/libbrep/common.hxx
+++ b/libbrep/common.hxx
@@ -66,7 +66,8 @@ void assert (int);
from(bpkg::version ((?).epoch, \
std::move ((?).upstream), \
std::move ((?).release), \
- (?).revision))
+ (?).revision, \
+ 0))
#pragma db map type(brep::optional_version) as(brep::_optional_version) \
to((?) \
@@ -81,7 +82,8 @@ void assert (int);
? bpkg::version ((?)->epoch, \
std::move ((?)->upstream), \
std::move ((?)->release), \
- (?)->revision) \
+ (?)->revision, \
+ 0) \
: brep::optional_version ())
namespace brep
@@ -157,14 +159,14 @@ namespace brep
#pragma db value transient
struct upstream_version: version
{
- #pragma db member(upstream_) virtual(string) \
- get(this.upstream) \
- set(this = brep::version (0, std::move (?), std::string (), 0))
+ #pragma db member(upstream_) virtual(string) \
+ get(this.upstream) \
+ set(this = brep::version (0, std::move (?), std::string (), 0, 0))
- #pragma db member(release_) virtual(optional_string) \
- get(this.release) \
- set(this = brep::version ( \
- 0, std::move (this.upstream), std::move (?), 0))
+ #pragma db member(release_) virtual(optional_string) \
+ get(this.release) \
+ set(this = brep::version ( \
+ 0, std::move (this.upstream), std::move (?), 0, 0))
upstream_version () = default;
upstream_version (version v): version (move (v)) {}
@@ -174,7 +176,7 @@ namespace brep
void
init (const canonical_version& cv, const upstream_version& uv)
{
- *this = version (cv.epoch, uv.upstream, uv.release, cv.revision);
+ *this = version (cv.epoch, uv.upstream, uv.release, cv.revision, 0);
assert (cv.canonical_upstream == canonical_upstream &&
cv.canonical_release == canonical_release);
}