aboutsummaryrefslogtreecommitdiff
path: root/bpkg/package.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-03-28 00:00:07 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-04-19 19:39:55 +0300
commit93d95938306e76a0f8b9422ea6b3cb4695610f73 (patch)
treee74208241110c4a7362d9773b3f95907f0be7167 /bpkg/package.hxx
parent9e8092a8b86f842f744920aa2bd034df9e978fd9 (diff)
Include drops into the overall plan
Diffstat (limited to 'bpkg/package.hxx')
-rw-r--r--bpkg/package.hxx19
1 files changed, 14 insertions, 5 deletions
diff --git a/bpkg/package.hxx b/bpkg/package.hxx
index 49c6bd0..c14f7fc 100644
--- a/bpkg/package.hxx
+++ b/bpkg/package.hxx
@@ -573,7 +573,7 @@ namespace bpkg
public:
using version_type = bpkg::version;
- string name; // Object id.
+ std::string name; // Object id.
version_type version;
package_state state;
package_substate substate;
@@ -624,7 +624,7 @@ namespace bpkg
// for details). Note that during the simulation the manifest may not be
// available.
//
- optional<string> manifest_checksum;
+ optional<std::string> manifest_checksum;
// Path to the output directory of this package, if any. It is
// always relative to the configuration directory, and is <name>
@@ -665,9 +665,15 @@ namespace bpkg
// Represent the wildcard version with the "*" string. Represent naturally
// all other versions.
//
- string
+ std::string
version_string () const;
+ std::string
+ string () const
+ {
+ return (system () ? "sys:" : "") + name + "/" + version_string ();
+ }
+
// Return the relative source directory completed using the configuration
// directory. Return the absolute source directory as is.
//
@@ -703,8 +709,11 @@ namespace bpkg
// Print the package name, version and the 'sys:' prefix for the system
// substate. The wildcard version is represented with the "*" string.
//
- ostream&
- operator<< (ostream&, const selected_package&);
+ inline ostream&
+ operator<< (ostream& os, const selected_package& p)
+ {
+ return os << p.string ();
+ }
// Check if the directory containing the specified package version should be
// considered its iteration. Return the version of this iteration if that's