From 3a6c4ab1b6fc79a6a543088553cdd6bc8cb0a1dd Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 21 May 2018 21:10:09 +0300 Subject: Adapt to inventing package_name type --- bpkg/manifest-utility.hxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'bpkg/manifest-utility.hxx') diff --git a/bpkg/manifest-utility.hxx b/bpkg/manifest-utility.hxx index c22746b..984786d 100644 --- a/bpkg/manifest-utility.hxx +++ b/bpkg/manifest-utility.hxx @@ -6,6 +6,7 @@ #define BPKG_MANIFEST_UTILITY_HXX #include +#include #include #include @@ -31,16 +32,16 @@ namespace bpkg package_scheme parse_package_scheme (const char*&); - // Extract and validate the package name and version components from - // [/]. + // Extract the package name and version components from [/]. + // Diagnose invalid components and throw failed. // - string - parse_package_name (const char*); + package_name + parse_package_name (const char*, bool allow_version = true); - inline string - parse_package_name (const string& s) + inline package_name + parse_package_name (const string& s, bool allow_version = true) { - return parse_package_name (s.c_str ()); + return parse_package_name (s.c_str (), allow_version); } // Return empty version if none is specified. -- cgit v1.1