diff --git a/uri.cpp.rl b/uri.cpp.rl index 759f4153..ad188a3c 100644 --- a/uri.cpp.rl +++ b/uri.cpp.rl @@ -25,7 +25,10 @@ #include #include +using util::uri; + +/////////////////////////////////////////////////////////////////////////////// %%{ machine impl; @@ -83,12 +86,18 @@ util::uri::uri (const char *str): //----------------------------------------------------------------------------- -util::uri::uri (const char *first, const char *last): - uri (std::string (first, last)) +uri::uri (util::view _value): + uri (std::string (_value.begin (), _value.end ())) { ; } -/////////////////////////////////////////////////////////////////////////////// +//----------------------------------------------------------------------------- +uri::uri (const std::string &_value): + uri (std::string (_value)) +{ ; } + + +//----------------------------------------------------------------------------- static const util::view NULL_VIEW { nullptr, nullptr }; diff --git a/uri.hpp b/uri.hpp index efee4747..dc12910e 100644 --- a/uri.hpp +++ b/uri.hpp @@ -41,8 +41,9 @@ namespace util { class uri { public: explicit uri (std::string &&); + explicit uri (const std::string&); explicit uri (const char *str); - uri (const char *first, const char *last); + explicit uri (util::view); class parse_error : public std::runtime_error { using runtime_error::runtime_error; };