Public Member Functions | Friends

atscppapi::Url Class Reference

This class contains all properties of a Url. More...

#include <Url.h>

Inherits atscppapi::noncopyable.

Collaboration diagram for atscppapi::Url:
Collaboration graph
[legend]

Public Member Functions

 ~Url ()
std::string getUrlString () const
std::string getPath () const
std::string getQuery () const
std::string getScheme () const
std::string getHost () const
uint16_t getPort () const
void setPath (const std::string &)
 Set the path of the url.
void setQuery (const std::string &)
 Set the query param of the url.
void setScheme (const std::string &)
 Set the scheme of the url.
void setHost (const std::string &)
 Set the host of the url.
void setPort (const uint16_t)
 Set the port portion of the url.
void reset ()
 This method allows you to reset the url, this will force the Url to fully re-read all cached values.

Friends

class Request
class ClientRequest
class RemapPlugin

Detailed Description

This class contains all properties of a Url.

You can use a Url object to get and set any property of a url.

Warning:
Url objects should never be constructed by the user. If a user needs to create an unbound Url then they should create a Request object using Request::Request(string) which will construct a Url object for them and it can be retrieved via Request::getUrl(). A full example of this is available in examples/detachedrequest/.

Definition at line 45 of file Url.h.


Constructor & Destructor Documentation

atscppapi::Url::~Url (  ) 

Member Function Documentation

std::string atscppapi::Url::getHost (  )  const
Returns:
The host only of the url, this might be www.google.com
std::string atscppapi::Url::getPath (  )  const
Returns:
The path only portion of the url, such as /search
uint16_t atscppapi::Url::getPort (  )  const
Returns:
The port only portion of the url, this will likely be 80 or 443.
std::string atscppapi::Url::getQuery (  )  const
Returns:
The query only portion of the url, which might be q=blah
std::string atscppapi::Url::getScheme (  )  const
Returns:
The scheme of the url, this will be either http or https.
std::string atscppapi::Url::getUrlString (  )  const
Returns:
The full url as a string, such a url might be http://trafficserver.apache.org/search?q=blah
void atscppapi::Url::reset (  ) 

This method allows you to reset the url, this will force the Url to fully re-read all cached values.

If this method is used on a Detached Requests' Url object it will completely destroy the values.

Note:
This method should rarely be used.
void atscppapi::Url::setHost ( const std::string &   ) 

Set the host of the url.

Parameters:
host this might be something such as www.linkedin.com or www.apache.org
void atscppapi::Url::setPath ( const std::string &   ) 

Set the path of the url.

Parameters:
path the path portion of the url to set, this might be something like /foo/bar
void atscppapi::Url::setPort ( const   uint16_t  ) 

Set the port portion of the url.

Parameters:
port this is a uint16_t which represents the port (in host order, there is no need to conver to network order). You might use a value such as 80 or 8080.
void atscppapi::Url::setQuery ( const std::string &   ) 

Set the query param of the url.

Parameters:
query the query portion of the url, this might be something like foo=bar&blah=baz.
void atscppapi::Url::setScheme ( const std::string &   ) 

Set the scheme of the url.

Parameters:
scheme this might be either http or https.

Friends And Related Function Documentation

friend class ClientRequest [friend]

Definition at line 143 of file Url.h.

friend class RemapPlugin [friend]

Definition at line 144 of file Url.h.

friend class Request [friend]

Definition at line 142 of file Url.h.


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