Google APIs Client Library for C++
|
The URI Support module provides various classes and free functions to support the use and application of URIs in general. More...
Classes | |
class | UriTemplate |
Provides the ability to produce concrete URLs from templated ones. More... | |
class | ParsedUrl |
Parses a url as described in 2.4 of RFC 1808. More... | |
Functions | |
string | ResolveUrl (const StringPiece &base_url, const StringPiece &new_url) |
Resolve a [possibly] relative url into an absolute url. | |
string | JoinPath (const StringPiece &a, const StringPiece &b) |
Join two fragments together into a path. | |
string | EscapeForUrl (const StringPiece &s) |
Escape a string so that it is valid in a URL. | |
template<typename T > | |
string | CppValueToEscapedUrlValue (const T &value) |
Templated function that encodes a primitive C++ value for use in a URL. | |
template<typename T > | |
void | AppendIteratorToUrl (const T &begin, const T &end, const StringPiece param_name, string *target) |
Templated function that encodes a C++ STL container for use as in a URL. |
The URI Support module provides various classes and free functions to support the use and application of URIs in general.
void AppendIteratorToUrl | ( | const T & | begin, |
const T & | end, | ||
const StringPiece | param_name, | ||
string * | target | ||
) |
Templated function that encodes a C++ STL container for use as in a URL.
Implements default templated AppendIteratorToUrl.
The values in the array are those returned by the iterator. This does not put a leading (or ending) separator so you should form the uri with either a leading '&' or '?' to indicate that parameters are following.
[in] | begin | The start of the array sequence. |
[in] | end | The end of the array sequence. |
[in] | param_name | The name of the URL parameter being added. |
[in,out] | target | The string to append the string-encoded value into. |
string CppValueToEscapedUrlValue | ( | const T & | value | ) | [inline] |
Templated function that encodes a primitive C++ value for use in a URL.
Implements append a scalar value into a URL.
[in] | value | The C++ value |
This function is intended for scalar types: [u]int(16|32|64)
string googleapis::client::EscapeForUrl | ( | const StringPiece & | s | ) |
Escape a string so that it is valid in a URL.
[in] | s | The string to escape. |
string googleapis::client::JoinPath | ( | const StringPiece & | a, |
const StringPiece & | b | ||
) |
Join two fragments together into a path.
[in] | a | The first fragment may or may not have a trailing '/'. |
[in] | b | The second fragment may or may not have a leading '/'. |
string googleapis::client::ResolveUrl | ( | const StringPiece & | base_url, |
const StringPiece & | new_url | ||
) |
Resolve a [possibly] relative url into an absolute url.
This function implements RFC 1808 Relative Uniform Resource Locators to resolve a url relative to a base url. Note that the actual RFC handles URLs embedded into complex documents. Here we only have a single base url.
[in] | base_url | The base url. |
[in] | new_url | The url to be resolved against the base. |