diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2018-02-21 08:31:32 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-02-21 08:31:32 +0300 |
commit | 34dd55af8432455c25cfe659841273bcd2b8e76a (patch) | |
tree | 047a610b192b874627df66092e066b75569f26da | |
parent | 18e40e91c99088ef5fb9458ec4c1ec21ddcc51e6 (diff) |
Add *_based() predicates to repository_location class
-rw-r--r-- | libbpkg/manifest.hxx | 19 |
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 |