diff --git a/README.md b/README.md index e5860be..68875a1 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ ------------------------------------------------------------------------ [![Ubuntu](https://github.com/fix8mt/uri/actions/workflows/cmake-single-platform.yml/badge.svg)](https://github.com/fix8mt/uri/actions/workflows/cmake-single-platform.yml) -![C++20](http://img.shields.io/badge/C++20-required-orange.svg) -![Boost Licence](http://img.shields.io/badge/license-boost-blue.svg) + + # Quick links |**Link**|**Description**| @@ -53,7 +53,8 @@ This is a lightweight URI parser implementation featuring zero-copy, minimal sto # 2. Examples ## i. Use `basic_uri` as a view -This example parses a list of URI strings and prints out `host` component. `basic_uri` creates a no-copy view of the source. +This example parses a list of URI strings and prints out `host` component. `basic_uri` creates a no-copy view of the source. `get_component()` +returns a `std::string_view`.
source

@@ -66,11 +67,12 @@ using namespace FIX8; int main(int argc, char *argv[]) { + using namespace std::literals; static constexpr const std::array uris { - "https://www.blah.com:3000/test", - "https://dakka@www.staylate.net:3000/", - "https://www.buyexample.com/over/there?name=ferret&time=any#afrag", + "https://www.blah.com:3000/test"sv, + "https://dakka@www.staylate.net:3000/"sv, + "https://www.buyexample.com/over/there?name=ferret&time=any#afrag"sv, }; for (const auto& pp : uris) std::cout << basic_uri(pp).get_component(uri::host) << '\n'; diff --git a/assets/badgeboostlic.svg b/assets/badgeboostlic.svg new file mode 100644 index 0000000..9ca7e23 --- /dev/null +++ b/assets/badgeboostlic.svg @@ -0,0 +1 @@ +license: boostlicenseboost \ No newline at end of file diff --git a/assets/badgecpprequired.svg b/assets/badgecpprequired.svg new file mode 100644 index 0000000..f29795a --- /dev/null +++ b/assets/badgecpprequired.svg @@ -0,0 +1 @@ +C++20: requiredC++20required \ No newline at end of file diff --git a/examples/uritest.cpp b/examples/uritest.cpp index c2da14b..9d9253c 100644 --- a/examples/uritest.cpp +++ b/examples/uritest.cpp @@ -138,6 +138,20 @@ int main(int argc, char *argv[]) std::cout << sizeof(uri_fixed<"telnet://user:password@192.0.2.16:80/">) << '\n'; std::cout << *ptr << '\n'; */ + /* + using namespace std::literals; + static constexpr const std::array uris + { + "https://www.blah.com:3000/test"sv, + "https://dakka@www.staylate.net:3000/"sv, + "https://www.buyexample.com/over/there?name=ferret&time=any#afrag"sv, + }; + for (const auto& pp : uris) + { + std::cout << typeid(pp).name() << '\n'; + std::cout << basic_uri(pp).get_component(uri::host) << '\n'; + } + */ } break; case 'l':