Uniform Resource Identifier. More...
#include <ruri.h>
Data Structures | |
struct | PartString |
Public Member Functions | |
RURI (void) | |
RURI (const RString &uri) | |
RURI (const char *uri) | |
RURI (const RURI &uri) | |
int | Compare (const RURI &uri) const |
int | Compare (const RString &uri) const |
int | Compare (const char *uri) const |
bool | operator== (const RURI &src) const |
bool | operator== (const char *src) const |
bool | operator== (const RString &src) const |
bool | operator!= (const RURI &src) const |
bool | operator!= (const char *src) const |
bool | operator!= (const RString &src) const |
bool | IsEmpty (void) const |
RString | GetScheme (void) const |
RString | GetAuthority (void) const |
RString | GetPath (void) const |
RString | GetPort (void) const |
RString | GetQuery (void) const |
RString | GetFragment (void) const |
RString | GetExtension (void) const |
RString | operator() (void) const |
RURI & | operator= (const RURI &uri) |
Private Member Functions | |
void | AnalyzeString (void) |
void | ReplaceChars (bool keepspaces=true) |
RString | Extract (const PartString &part) const |
Private Attributes | |
RString | URI |
PartString | Scheme |
PartString | Authority |
PartString | Path |
PartString | Port |
PartString | Query |
PartString | Fragment |
Detailed Description
Uniform Resource Identifier.
This class implements a basic support of URI (Uniform Resource Identifier), in particular for the schemes involving files.
Here are two examples explaining how it is handle by the RURI class:
Under windows, the '\' is replaced by the '/'. For example:
is transformed in:
- Remarks
- The whole specification is not supported.
Constructor & Destructor Documentation
RURI | ( | void | ) |
Default constructor.
Constructor of uniform resource identifier.
- Parameters
-
uri String representing the URI.
RURI | ( | const char * | uri | ) |
Constructor of uniform resource identifier.
- Parameters
-
uri String representing the URI.
Member Function Documentation
|
private |
Analyze the current URI.
|
private |
Replace certain characters such as '\' by '/' or ' ' by '%20'.
- Parameters
-
keepspaces Specify if the spaces must be keeped or replaced by '%20'.
|
private |
Extract a given part of the URI based on a structure.
- Parameters
-
part Part of the string to extract.
int Compare | ( | const RURI & | uri | ) | const |
Compare method used by R::RContainer.
- Parameters
-
uri URI used for the comparisons.
int Compare | ( | const RString & | uri | ) | const |
Compare method used by R::RContainer.
- Parameters
-
uri URI used for the comparisons.
int Compare | ( | const char * | uri | ) | const |
Compare method used by R::RContainer.
- Parameters
-
uri URI used for the comparisons.
bool operator== | ( | const RURI & | src | ) | const |
Equal operator.
- Parameters
-
src URI to compare with.
bool operator== | ( | const char * | src | ) | const |
Equal operator.
- Parameters
-
src String to compare with.
bool operator== | ( | const RString & | src | ) | const |
Equal operator.
- Parameters
-
src String to compare with.
bool operator!= | ( | const RURI & | src | ) | const |
Non-equal operator.
- Parameters
-
src URI to compare with.
bool operator!= | ( | const char * | src | ) | const |
Non-equal operator.
- Parameters
-
src String to compare with.
bool operator!= | ( | const RString & | src | ) | const |
Non-equal operator.
- Parameters
-
src String to compare with.
bool IsEmpty | ( | void | ) | const |
Look if the URI is an empty one.
- Returns
- true if it is the case.
RString GetScheme | ( | void | ) | const |
Get the Scheme part of the uniform resource identifier.
RString GetAuthority | ( | void | ) | const |
Get the authority part of the uniform resource identifier.
RString GetPath | ( | void | ) | const |
Get the path part of the uniform resource identifier.
RString GetPort | ( | void | ) | const |
Get the port part of the uniform resource identifier.
RString GetQuery | ( | void | ) | const |
Get the query part of the uniform resource identifier.
RString GetFragment | ( | void | ) | const |
Get the fragment part of the uniform resource identifier.
RString GetExtension | ( | void | ) | const |
Get the extension of a file.
RString operator() | ( | void | ) | const |
- Returns
- String representing the URI.
Assignment operator using another URI.
- Parameters
-
uri Source URI.
Field Documentation
|
private |
The URI.
|
private |
Structure identifying the schema of the URI.
|
private |
Structure identifying the authority of the URI.
|
private |
Structure identifying the path of the URI
|
private |
Structure identifying the port of the URI
|
private |
Structure identifying the query of the URI.
|
private |
Structure identifying the fragment of the URI.