UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
anonymous_namespace{uri.cpp} Namespace Reference

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.
 

Function Documentation

◆ is_reserved()

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.

Returns
1 if char is a RESERVED char, otherwise 0.
Parameters
[in]inChar to be matched for RESERVED characters.

Definition at line 72 of file uri.cpp.

+ Here is the caller graph for this function:

◆ is_mark()

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).

Returns
1 if char is a MARKED char, otherwise 0.
Parameters
[in]inChar to be matched for MARK characters.

Definition at line 90 of file uri.cpp.

+ Here is the caller graph for this function:

◆ is_unreserved()

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).

Returns
1 if char is a UNRESERVED char, otherwise 0.
Parameters
[in]inChar to be matched for UNRESERVED characters.

Definition at line 108 of file uri.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_escaped()

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).

Returns
1 if char is a ESCAPED char, otherwise 0.
Parameters
[in]inChar sequence to be matched for ESCAPED characters.

Definition at line 126 of file uri.cpp.

+ Here is the caller graph for this function:

◆ parse_uric()

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).

Returns
???
Parameters
[in]inString of characters.
[in]maxMaximum limit.
[out]outToken object where the string of characters is copied.

Definition at line 146 of file uri.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copy_token()

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).

Parameters
[in]inSource token.
[in]in_base
[out]outDestination token.
[in]out_base

Definition at line 175 of file uri.cpp.

+ Here is the caller graph for this function:

◆ parse_hostport()

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.

Parameters
[in]inString of characters representing host and port.
[out]defaultPortOutput parameter where the host and port are represented as an internet address.
[out]outThe netaddress (with port)

Definition at line 196 of file uri.cpp.

+ Here is the caller graph for this function:

◆ parse_scheme()

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–

Note
String MUST include ':' within the max charcters.
Returns
size of the scheme identifier (e.g. 4 for "http"). Will be 0 with invalid scheme identifier.
Parameters
[in]inString of characters representing a scheme.
[in]maxMaximum number of characters.
[out]outOutput parameter whose buffer is filled in with the scheme.

Definition at line 350 of file uri.cpp.

+ Here is the caller graph for this function:

◆ is_end_path()

int anonymous_namespace{uri.cpp}::is_end_path ( char  c)
inline

Check if end of a path.

Definition at line 382 of file uri.cpp.

+ Here is the caller graph for this function: