From 41c2026a10be5fc73986eba037fac6993d5cdb64 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 1 May 2020 18:07:07 +0300 Subject: Rename bpkg::url class to bpkg::manifest_url not to clash with butl::url in some contexts --- libbpkg/manifest.cxx | 21 +++++++++++---------- libbpkg/manifest.hxx | 15 +++++++-------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/libbpkg/manifest.cxx b/libbpkg/manifest.cxx index c1c541f..9caa229 100644 --- a/libbpkg/manifest.cxx +++ b/libbpkg/manifest.cxx @@ -606,10 +606,12 @@ namespace bpkg return *this; } - // url + // manifest_url // - url:: - url (const std::string& u, std::string c): butl::url (u), comment (move (c)) + manifest_url:: + manifest_url (const std::string& u, std::string c) + : url (u), + comment (move (c)) { if (rootless) throw invalid_argument ("rootless URL"); @@ -1643,18 +1645,19 @@ namespace bpkg r = bpkg::parse_email (nv, what, source_name, empty); }; - auto parse_url = [&bad_value] (const string& v, const char* what) -> url + auto parse_url = [&bad_value] (const string& v, + const char* what) -> manifest_url { auto p (parser::split_comment (v)); if (v.empty ()) bad_value (string ("empty ") + what + " url"); - url r; + manifest_url r; try { - r = url (p.first, move (p.second)); + r = manifest_url (p.first, move (p.second)); } catch (const invalid_argument& e) { @@ -3270,7 +3273,7 @@ namespace bpkg { try { - return path_type (butl::url::decode (path)); + return path_type (url::decode (path)); } catch (const invalid_path&) { @@ -3281,8 +3284,6 @@ namespace bpkg repository_url_traits::string_type repository_url_traits:: translate_path (const path_type& path) { - using butl::url; - // If the path is absolute then this is a local URL object and the file:// // URL notation is being produced. Thus, on POSIX we need to make the path // relative (to the authority "root"). On Windows the path should stay @@ -3377,7 +3378,7 @@ namespace bpkg typed_repository_url:: typed_repository_url (const string& s) { - using traits = butl::url::traits_type; + using traits = url::traits_type; if (traits::find (s) == 0) // Looks like a non-rootless URL? { diff --git a/libbpkg/manifest.hxx b/libbpkg/manifest.hxx index 05b6dfc..b82b87e 100644 --- a/libbpkg/manifest.hxx +++ b/libbpkg/manifest.hxx @@ -276,7 +276,7 @@ namespace bpkg // // See libbutl/url.mxx for details. // - class url: public butl::url + class manifest_url: public butl::url { public: std::string comment; @@ -284,9 +284,9 @@ namespace bpkg // Throw invalid_argument on parsing or constraints checking error. // explicit - url (const std::string& u, std::string c = ""); + manifest_url (const std::string& u, std::string c = ""); - url () = default; + manifest_url () = default; }; // email @@ -673,7 +673,6 @@ namespace bpkg public: using version_type = bpkg::version; using priority_type = bpkg::priority; - using url_type = bpkg::url; using email_type = bpkg::email; package_name name; @@ -694,10 +693,10 @@ namespace bpkg butl::optional description; butl::optional description_type; butl::small_vector changes; - butl::optional url; - butl::optional doc_url; - butl::optional src_url; - butl::optional package_url; + butl::optional url; + butl::optional doc_url; + butl::optional src_url; + butl::optional package_url; butl::optional email; butl::optional package_email; butl::optional build_email; -- cgit v1.1