You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
859 B

#ifndef URL_H
#define URL_H
#include <string>
#include <memory>
#include <iostream>
struct Authority {
std::string userinfo;
std::string host;
int port;
struct URL {
URL(std::string const& url);
std::string toString() const;
bool isRelative() const;
URL merge(URL const& url) const;
// switching to the official RFC names
std::string scheme; // was protocol
//struct Authority authority; /* Can be empty */
std::string userinfo;
std::string host;
int port;
std::string path; // was document
std::string query; // ?blablabla=asdfasf....
std::string fragment; // #asfawefm
void construct(std::string const& url);
URL copy() const;
std::unique_ptr<URL> parseUri(std::string raw);
std::ostream& operator<<(std::ostream& out, URL const& url);