Skip to content

hypercore-cxx/cxx-uri

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SYNOPSIS

a little C++ library that parses URLs into bite-sized pieces.

EXAMPLE

#include <iostream>
#include <nodeuv-uri.h>

using namespace std;
using namespace uri;

int main() {

  string haystack = "http://user:password@www.google.com:80/path?search=foo&bar=bazz";

  auto u = ParseHttpUrl(haystack);
 
  cout << "Protocol:       " << u.protocol << "\n"
       << "User:           " << u.user << "\n"
       << "Password:       " << u.password << "\n"
       << "Host:           " << u.host << "\n"
       << "Port:           " << u.port << "\n"
       << "Path:           " << u.path << "\n"
       << "Search:         " << u.search << "\n"
       << "Query (search): " << u.query.at("search") << "\n"
       << "Query (bar):    " << u.query.at("bar") << "\n" << endl;
}

This is based on the url spec defined in RFC 1738.e

License

This code is licensed under the MIT License. See LICENSE.txt.

About

a simple parser, encoder and decoder for URIs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 74.4%
  • C++ 25.6%