From 34dd55af8432455c25cfe659841273bcd2b8e76a Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 21 Feb 2018 08:31:32 +0300 Subject: Add *_based() predicates to repository_location class --- libbpkg/manifest.hxx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libbpkg/manifest.hxx') 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 -- cgit v1.1