This library provides:
- A
skyr::urlclass that implements a generic URI parser, compatible with WhatWG URL specification - Percent encoding and decoding functions
- IDNA and Punycode functions for domain name parsing
mkdir _build
cd _build
cmake ..
make -j4make testauto url = skyr::make_url("http://example.org/\xf0\x9f\x92\xa9");
std::cout << url.value().pathname() << std::endl;Gives the output: /%F0%9F%92%A9
auto url = skyr::make_url(U"/\u1F363\1F37A");
if (!url) {
std::cerr << "Parsing failed" << std::endl;
}Gives the output: Parsing failed
auto base = skyr::make_url("https://url.spec.whatwg.org/");
auto url = skyr::make_url(U"/\u1F363\1F37A", base.value());
if (url) {
std::cout << url.value().href() << std::endl;
}Gives the output: https://url.spec.whatwg.org/%F0%9F%8D%A3%F0%9F%8D%BA
This library uses optional and expected.
The tests are built using Google Test.
This library has been tested using the following compilers:
Linux:
- GCC 6
- GCC 7
- GCC 8
- Clang 5
- Clang 6
MacOS:
- Clang 5
- Clang 6
Windows:
- Visual Studio 2017
This library is released under the Boost Software License (please see http://boost.org/LICENSE_1_0.txt or the accompanying LICENSE_1_0.txt file for the full text.
Any questions about this library can be addressed to the cpp-netlib developers mailing list. Issues can be filed using Github at http://github.com/cpp-netlib/uri/issues.
