Sane C++ Libraries
C++ Platform Abstraction Libraries
SC::HttpURLParser Struct Reference

Parse an URL splitting it into its base components. More...

#include <HttpURLParser.h>

Public Member Functions

Result parse (StringView url)
 Parse StringView representing an URL. More...
 

Public Attributes

StringView protocol
 Returns http (from http://user:pass@site.com:80/pa/th?q=val#hash) More...
 
StringView username
 Returns user (from http://user:pass@site.com:80/pa/th?q=val#hash) More...
 
StringView password
 Returns pass (from http://user:pass@site.com:80/pa/th?q=val#hash) More...
 
StringView hostname
 Returns site.com (from http://user:pass@site.com:80/pa/th?q=val#hash) More...
 
uint16_t port
 Returns 80 (from http://user:pass@site.com:80/pa/th?q=val#hash) More...
 
StringView host
 Returns site.com:80 (from http://user:pass@site.com:80/pa/th?q=val#hash) More...
 
StringView pathname
 Returns /pa/th (from http://user:pass@site.com:80/pa/th?q=val#hash) More...
 
StringView path
 Returns /pa/th?q=val (from http://user:pass@site.com:80/pa/th?q=val#hash) More...
 
StringView search
 Returns ?q=val (from http://user:pass@site.com:80/pa/th?q=val#hash) More...
 
StringView hash
 Returns #hash (from http://user:pass@site.com:80/pa/th?q=val#hash) More...
 

Detailed Description

Parse an URL splitting it into its base components.

Member Function Documentation

◆ parse()

Result SC::HttpURLParser::parse ( StringView  url)

Parse StringView representing an URL.

Parameters
urlThe url to be parsed
Returns
Valid Result if parse was successful

Member Data Documentation

◆ hash

StringView SC::HttpURLParser::hash

Returns #hash (from http://user:pass@site.com:80/pa/th?q=val#hash)

◆ host

StringView SC::HttpURLParser::host

Returns site.com:80 (from http://user:pass@site.com:80/pa/th?q=val#hash)

◆ hostname

StringView SC::HttpURLParser::hostname

Returns site.com (from http://user:pass@site.com:80/pa/th?q=val#hash)

◆ password

StringView SC::HttpURLParser::password

Returns pass (from http://user:pass@site.com:80/pa/th?q=val#hash)

◆ path

StringView SC::HttpURLParser::path

Returns /pa/th?q=val (from http://user:pass@site.com:80/pa/th?q=val#hash)

◆ pathname

StringView SC::HttpURLParser::pathname

Returns /pa/th (from http://user:pass@site.com:80/pa/th?q=val#hash)

◆ port

uint16_t SC::HttpURLParser::port

Returns 80 (from http://user:pass@site.com:80/pa/th?q=val#hash)

◆ protocol

StringView SC::HttpURLParser::protocol

Returns http (from http://user:pass@site.com:80/pa/th?q=val#hash)

◆ search

StringView SC::HttpURLParser::search

Returns ?q=val (from http://user:pass@site.com:80/pa/th?q=val#hash)

◆ username

StringView SC::HttpURLParser::username

Returns user (from http://user:pass@site.com:80/pa/th?q=val#hash)


The documentation for this struct was generated from the following file: