Functions | |
Scope restricted to file | |
int | is_reserved (const unsigned char in) |
Check for a RESERVED character. | |
int | is_mark (const unsigned char in) |
Check for a MARK character. | |
int | is_unreserved (const unsigned char in) |
Check for an UNRESERVED character. | |
int | is_escaped (const unsigned char *in) |
Check that a char[3] sequence is ESCAPED. | |
size_t | parse_uric (const char *in, size_t max, token *out) |
Parses a string of uric characters starting at in[0]. | |
void | copy_token (const token *in, const char *in_base, token *out, char *out_base) |
Copy the offset and size from a token to another token. | |
int | parse_hostport (const char *in, unsigned short int defaultPort, hostport_type *out) |
Parses a string with host and port and fills a hostport structure. | |
size_t | parse_scheme (const char *in, size_t max, token *out) |
parses a uri scheme starting at in[0]. | |
int | is_end_path (char c) |
Check if end of a path. | |
int anonymous_namespace{uri.cpp}::is_reserved | ( | const unsigned char | in | ) |
Check for a RESERVED character.
Returns a 1 if a char is a RESERVED char as defined in RFC 2396 (explaining URIs). Added {} for compatibility.
[in] | in | Char to be matched for RESERVED characters. |
Definition at line 72 of file uri.cpp.
int anonymous_namespace{uri.cpp}::is_mark | ( | const unsigned char | in | ) |
Check for a MARK character.
Returns a 1 if a char is a MARK char as defined in RFC 2396 (explaining URIs).
[in] | in | Char to be matched for MARK characters. |
Definition at line 90 of file uri.cpp.
int anonymous_namespace{uri.cpp}::is_unreserved | ( | const unsigned char | in | ) |
Check for an UNRESERVED character.
Returns a 1 if a char is an UNRESERVED char as defined in RFC 2396 (explaining URIs).
[in] | in | Char to be matched for UNRESERVED characters. |
Definition at line 108 of file uri.cpp.
int anonymous_namespace{uri.cpp}::is_escaped | ( | const unsigned char * | in | ) |
Check that a char[3] sequence is ESCAPED.
Returns a 1 if a char[3] sequence is ESCAPED as defined in RFC 2396 (explaining URIs).
[in] | in | Char sequence to be matched for ESCAPED characters. |
Definition at line 126 of file uri.cpp.
size_t anonymous_namespace{uri.cpp}::parse_uric | ( | const char * | in, |
size_t | max, | ||
token * | out | ||
) |
Parses a string of uric characters starting at in[0].
As defined in RFC 2396 (explaining URIs).
[in] | in | String of characters. |
[in] | max | Maximum limit. |
[out] | out | Token object where the string of characters is copied. |
Definition at line 146 of file uri.cpp.
void anonymous_namespace{uri.cpp}::copy_token | ( | const token * | in, |
const char * | in_base, | ||
token * | out, | ||
char * | out_base | ||
) |
Copy the offset and size from a token to another token.
Tokens are generally pointers into other strings. This copies the offset and size from a token (in) relative to one string (in_base) into a token (out) relative to another string (out_base).
[in] | in | Source token. |
[in] | in_base | |
[out] | out | Destination token. |
[in] | out_base |
Definition at line 175 of file uri.cpp.
int anonymous_namespace{uri.cpp}::parse_hostport | ( | const char * | in, |
unsigned short int | defaultPort, | ||
hostport_type * | out | ||
) |
Parses a string with host and port and fills a hostport structure.
Parses a string representing a host and port (e.g. "127.127.0.1:80" or "localhost") and fills out a hostport_type struct with internet address and a token representing the full host and port. Uses getaddrinfo() to resolve DNS names. This may result in a longer delay until response from the internet.
[in] | in | String of characters representing host and port. |
[out] | defaultPort | Output parameter where the host and port are represented as an internet address. |
[out] | out | The netaddress (with port) |
Definition at line 196 of file uri.cpp.
size_t anonymous_namespace{uri.cpp}::parse_scheme | ( | const char * | in, |
size_t | max, | ||
token * | out | ||
) |
parses a uri scheme starting at in[0].
As defined in RFC 2396 (explaining URIs) (e.g. "http:" -> scheme= "http").
The funcion parses also opaque URIs. A URI is opaque if, and only if, it is absolute and its scheme-specific part does not begin with a slash character ('/'). An opaque URI has a scheme, a scheme-specific part, and possibly a fragment; all other components are undefined. A typical example of an opaque uri is a mail to url **mailto:a@b.c.nosp@m.om**.
REF: http://docs.oracle.com/javase/8/docs/api/java/net/URI.html#isOpaque–
[in] | in | String of characters representing a scheme. |
[in] | max | Maximum number of characters. |
[out] | out | Output parameter whose buffer is filled in with the scheme. |
Definition at line 350 of file uri.cpp.