Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion::remote::HttpClient::Url Struct Reference

Simple wrapper around a URL. More...

#include "httpclient.h"

Collaboration diagram for ion::remote::HttpClient::Url:

Public Member Functions

 Url ()
 Constructs an empty, invalid Url. More...
 
 Url (const std::string &url)
 Constructs the Url from the passed value. More...
 
void Set (const std::string &url)
 Sets the url from the passed value. More...
 
bool IsValid () const
 Returns whether this Url is valid. More...
 

Public Attributes

int port
 The remote host's port. More...
 
bool is_https
 Whether the connection is HTTPS or HTTP. More...
 
std::string hostname
 The remote host's name. More...
 
std::string path
 The path on the remote host. More...
 
std::map< std::string,
std::string > 
args
 Any query arguments in the Url. More...
 

Detailed Description

Simple wrapper around a URL.

Definition at line 35 of file httpclient.h.

Constructor & Destructor Documentation

ion::remote::HttpClient::Url::Url ( )

Constructs an empty, invalid Url.

Definition at line 114 of file httpclient.cc.

ion::remote::HttpClient::Url::Url ( const std::string &  url)
explicit

Constructs the Url from the passed value.

Definition at line 117 of file httpclient.cc.

References Set().

Member Function Documentation

bool ion::remote::HttpClient::Url::IsValid ( ) const

Returns whether this Url is valid.

A Url is considered valid if it contains a valid port and a non-empty hostname.

Definition at line 208 of file httpclient.cc.

void ion::remote::HttpClient::Url::Set ( const std::string &  url)

Sets the url from the passed value.

Definition at line 121 of file httpclient.cc.

References DCHECK, ion::port::ERROR, LOG, ion::base::SplitString(), and ion::base::StringToInt32().

Referenced by Url().

Member Data Documentation

std::map<std::string, std::string> ion::remote::HttpClient::Url::args

Any query arguments in the Url.

For example, ?arg1=val1&arg2=val2 produces args[arg1] = val1, args[arg2] = val2.

Definition at line 57 of file httpclient.h.

std::string ion::remote::HttpClient::Url::hostname

The remote host's name.

Definition at line 52 of file httpclient.h.

bool ion::remote::HttpClient::Url::is_https

Whether the connection is HTTPS or HTTP.

Definition at line 50 of file httpclient.h.

std::string ion::remote::HttpClient::Url::path

The path on the remote host.

Definition at line 54 of file httpclient.h.

int ion::remote::HttpClient::Url::port

The remote host's port.

Definition at line 48 of file httpclient.h.


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