Skip to content

Commit

Permalink
Rename upa::url_str_view_t to upa::string_view and use it throughout …
Browse files Browse the repository at this point in the history
…the library
  • Loading branch information
rmisev committed Sep 7, 2023
1 parent 23eab11 commit 49dd9b1
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 70 deletions.
2 changes: 1 addition & 1 deletion examples/urlparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// https://github.com/kazuho/picojson
# include "picojson/picojson.h"

using string_view = upa::url::str_view_type;
using string_view = upa::string_view;


// Parse URL and output result to console
Expand Down
8 changes: 4 additions & 4 deletions include/upa/str_arg.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ inline void procfn(Args&&... args) {

#ifdef UPA_CPP_17
# include <string_view>
# define UPA_URL_STR_VIEW_TYPE std::string_view
# define UPA_STRING_VIEW_TYPE std::string_view
#else
# include "str_view.h"
# define UPA_URL_STR_VIEW_TYPE upa::str_view<char>
# define UPA_STRING_VIEW_TYPE upa::str_view<char>
#endif

namespace upa {

// String view type

using url_str_view_t = UPA_URL_STR_VIEW_TYPE;
using string_view = UPA_STRING_VIEW_TYPE;

// Supported char and size types

Expand Down Expand Up @@ -265,7 +265,7 @@ inline std::string&& make_string(std::string&& str) {
}

template <class ...Args, enable_if_str_arg_to_char8_t<Args...> = 0>
inline url_str_view_t make_string(Args&&... args) {
inline string_view make_string(Args&&... args) {
const auto inp = make_str_arg(std::forward<Args>(args)...);
return { inp.data(), inp.length() };
}
Expand Down
Loading

0 comments on commit 49dd9b1

Please sign in to comment.