aboutsummaryrefslogtreecommitdiff
path: root/libbrep/common.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-05-24 00:25:45 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-05-24 17:11:47 +0300
commit6ce19c537bd9de8d3c9821841bc5ed680b762742 (patch)
tree2a487b1d5ec75b05e3001a461f149e14e5a859a8 /libbrep/common.hxx
parent3363e1239973a66722f681999771964e39a98332 (diff)
Adapt to inventing package_name type
Diffstat (limited to 'libbrep/common.hxx')
-rw-r--r--libbrep/common.hxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/libbrep/common.hxx b/libbrep/common.hxx
index 0950e7f..7860876 100644
--- a/libbrep/common.hxx
+++ b/libbrep/common.hxx
@@ -9,6 +9,8 @@
#include <chrono>
#include <type_traits> // static_assert
+#include <libbpkg/package-name.hxx>
+
#include <libbrep/types.hxx>
#include <libbrep/utility.hxx>
@@ -188,14 +190,24 @@ namespace brep
//
extern const version wildcard_version;
+ // package_name
+ //
+ using bpkg::package_name;
+
+ #pragma db value(package_name) type("CITEXT")
+
+ #pragma db map type("CITEXT") as("TEXT") to("(?)::CITEXT") from("(?)::TEXT")
+
+ // package_id
+ //
#pragma db value
struct package_id
{
- string name;
+ package_name name;
canonical_version version;
package_id () = default;
- package_id (string n, const brep::version& v)
+ package_id (package_name n, const brep::version& v)
: name (move (n)),
version {
v.epoch, v.canonical_upstream, v.canonical_release, v.revision}