|
| Uri () noexcept |
| Instantiates the object with default parameters (default constructor). Initializes an object.
|
|
bool | Parse (const char *str) noexcept |
| Parses a URI string. More...
|
|
bool | SetUri (const char *scheme, const char *userinfo, const char *host, const char *port, const char *path, const char *query, const char *fragment) noexcept |
| Sets the various parts of the URI. More...
|
|
errno_t | ComposeString (OutputStream *os) const noexcept |
| Writes a URI string. More...
|
|
bool | ComposeString (char *buf, size_t size) const noexcept |
| Writes a URI string. More...
|
|
template<size_t N> |
bool | ComposeString (char(&buf)[N]) const noexcept |
| Writes a URI string. More...
|
|
bool | AddBaseUri (const Uri &relative, const Uri &base) noexcept |
| Resolves a relative path. More...
|
|
const char * | GetScheme () const noexcept |
| Returns the string for the URI scheme (such as "http" or "file"). More...
|
|
const char * | GetUserInfo () const noexcept |
| Gets user-specific information (like a user name and password) associated with the specified URI. More...
|
|
const char * | GetHost () const noexcept |
| Gets the hostname. More...
|
|
const char * | GetPort () const noexcept |
| Gets the string that is the port number. More...
|
|
const char * | GetPath () const noexcept |
| Gets a path. More...
|
|
const char * | GetQuery () const noexcept |
| Gets a query string. More...
|
|
const char * | GetFragment () const noexcept |
| Gets a fragment string. More...
|
|
void | Reset () noexcept |
| Initializes (resets) an object.
|
|
|
static bool | IsReserved (int c) noexcept |
| Returns true if c is a reserved character in RFC 3986.
|
|
static bool | IsUnreserved (int c) noexcept |
| Returns true if c is an unreserved character in RFC 3986.
|
|
static bool | IsHexDigit (int c) noexcept |
| Returns true if the value is a hexadecimal number.
|
|
static errno_t | DecodeUriComponent (InputStream *is, OutputStream *os) noexcept |
| Decodes a percent-encoded string. More...
|
|
static errno_t | EncodeUriComponent (InputStream *is, OutputStream *os, bool fragment_mode=false) noexcept |
| Percent-encodes a string. More...
|
|
static errno_t | DecodeUriComponent (size_t *written, char *buf, size_t n, const char *s) noexcept |
| Decodes a percent-encoded string. More...
|
|
static errno_t | EncodeUriComponent (size_t *written, char *buf, size_t n, const char *s, bool fragment_mode) noexcept |
| Percent-encodes a string. More...
|
|
static errno_t | DecodePath (size_t *written, char *buf, size_t n, const char *s) noexcept |
| Decodes a percent-encoded string. This function is the same as DecodeUriComponent , except that it returns EILSEQ if the decoded character is the forward slash ('/').
|
|
static errno_t | EncodePath (size_t *written, char *buf, size_t n, const char *s) noexcept |
| Percent-encodes a string. This function is the same as EncodeUriComponent , except that it does not percent-encode the forward slash ( ' / ' ).
|
|
template<size_t N> |
static errno_t | DecodeUriComponent (size_t *written, char(&buf)[N], const char *s) noexcept |
| Calls DecodeUriComponent(written, buf, N, s) .
|
|
template<size_t N> |
static errno_t | EncodeUriComponent (size_t *written, char(&buf)[N], const char *s, bool fragment_mode) noexcept |
| Calls EncodeUriComponent(written, buf, N, s, fragment_mode) .
|
|
template<size_t N> |
static errno_t | DecodePath (size_t *written, char(&buf)[N], const char *s) noexcept |
| Calls DecodePath(written, buf, N, s) .
|
|
template<size_t N> |
static errno_t | EncodePath (size_t *written, char(&buf)[N], const char *s) noexcept |
| Calls EncodePath(written, buf, N, s) .
|
|
The class for parsing and constructing regular URIs.
- Description
- The
HttpStyleUri
and FileStyleUri
classes parse URIs using this class.
- This class is also used with relative URIs (relative paths). When a URI is parsed, some of the percent-encoded characters are decoded. The characters that are decoded belong to
unreserved(ALPHA / DIGIT / "-" / "." / "_" / "~")
in RFC 3986. Other percent-encoded characters are left the way they are.
- For details, see RFC 3986 (https://www.ietf.org/rfc/rfc3986.txt).
uri.Parse("http://www.example.com/dir/index.html?query=test#part1");
uri.GetScheme();
uri.GetHost();
uri.GetPath();
uri.GetQuery();
uri.GetFragment();
- Examples:
- misc/uri/uri.cpp.
Definition at line 18 of file Uri.h.