aboutsummaryrefslogtreecommitdiff
path: root/libbpkg/manifest.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-02-21 08:31:32 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-02-21 08:31:32 +0300
commit34dd55af8432455c25cfe659841273bcd2b8e76a (patch)
tree047a610b192b874627df66092e066b75569f26da /libbpkg/manifest.hxx
parent18e40e91c99088ef5fb9458ec4c1ec21ddcc51e6 (diff)
Add *_based() predicates to repository_location class
Diffstat (limited to 'libbpkg/manifest.hxx')
-rw-r--r--libbpkg/manifest.hxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/libbpkg/manifest.hxx b/libbpkg/manifest.hxx
index a4721d7..548312d 100644
--- a/libbpkg/manifest.hxx
+++ b/libbpkg/manifest.hxx
@@ -715,6 +715,25 @@ namespace bpkg
return url_.fragment;
}
+ bool
+ archive_based () const
+ {
+ switch (type ())
+ {
+ case repository_type::bpkg: return true;
+ case repository_type::git: return false;
+ }
+
+ assert (false); // Can't be here.
+ return false;
+ }
+
+ bool
+ version_control_based () const
+ {
+ return !archive_based ();
+ }
+
// String representation of an empty location is the empty string.
//
std::string