- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# FUUri Class Reference
[Utility Classes.]

A simple URI structure. More...

`#include <FUUri.h>`

List of all members.

## Public Types
enum | Scheme { NONE, FILE, FTP, HTTP, HTTPS }
## Public Member Functions
| FUUri ()
| Constructor.
| FUUri (const fstring &uri, bool escape=false)
| Constructor.
| FUUri (Scheme scheme, const fstring &username, const fstring &passwd, const fstring &host, uint32 port, const fstring &path=FC(""), const fstring &query=FC(""), const fstring &fragment=FC(""))
| Constructor.
| FUUri (Scheme scheme, const fstring &host, const fstring &path=FC(""), const fstring &fragment=FC(""))
| Constructor.
| FUUri (const fstring &path, const fstring &fragment)
| Constructor.
Scheme | GetScheme () const
| Retrieves the scheme from the URI.
const fstring & | GetSchemeDelimiter () const
| Retrieves the scheme delimiter from the URI.
fstring | GetUserInformations () const
| Retrieves the user information from the URI.
const fstring & | GetHostname () const
| Retrieves the host information from the URI.
uint32 | GetPort () const
| Retrieves the port number from the URI.
void | SetPort (uint32 _port)
| Sets the port number of the URI.
const fstring & | GetPath () const
| Retrieves the path from the URI.
const fstring & | GetQuery () const
| Retrieves the query from the URI.
void | SetQuery (const fstring &_query)
| Sets the query of the URI.
const fstring & | GetFragment () const
| Retrieves the fragment from the URI.
void | SetFragment (const fstring &_fragment)
| Sets the fragment of the URI.
fstring | GetAuthority () const
| Retrieves the authority string from the URI.
fstring | GetAbsolutePath () const
| Retrieves an absolute path from the URI.
fstring | GetAbsoluteUri (bool fragment=true) const
| Retrieves an absolute URI string from the URI.
fstring | GetRelativeUri (const FUUri &uri) const
| Retrieves an relative URI string from the URI.
fstring | MakeRelative (const fstring &path) const
| Makes a relative path from a uri.
fstring | MakeAbsolute (const fstring &relativePath) const
| Makes an absolute path from a relative path and this URI.
void | MakeAbsolute (FUUri &uri) const
| Makes the passed in URI relative to this URI.
FUUri | Resolve (const fstring &relativePath) const
| Resolves a URI from a relative path against this URI.
bool | IsFile () const
| Retrieves whether this URI points to a file.
## Static Public Member Functions
static fstring | Escape (const fstring &path)
| Escapes a path.

## Detailed Description

A simple URI structure.

This structure is quite incomplete but covers all the necessary cases for now. Possible upgrades to support all five parts: SCHEME://HOSTNAME/FILENAME@ARGUMENTS#DAE_ID

[scheme:][schemeDelimiter][userInfo@][host][:port][/path][?query][fragment]

Right now, SCHEME must always be "file://". HOSTNAME, on Windows, can be a UNC computer name. No other hostname types are supported. ARGUMENTS are not supported.

## Constructor & Destructor Documentation

FUUri::FUUri | ( | const fstring & | uri,
|  | bool | escape = `false`
| ) |

  | Constructor. Parameters:
  | uri | The string value for the URI.
  | escape | Whether to escape the strings.

FUUri::FUUri | ( | Scheme | scheme,
|  | const fstring & | username,
|  | const fstring & | passwd,
|  | const fstring & | host,
|  | uint32 | port,
|  | const fstring & | path = `FC("")`,
|  | const fstring & | query = `FC("")`,
|  | const fstring & | fragment = `FC("")`
| ) |

  | Constructor. Parameters:
  | scheme | The scheme to use in the construction of the URI.
  | username | The username to use in the construction of the URI.
  | passwd | The password to use in the construction of the URI.
  | host | The host to use in the construction of the URI.
  | port | The port to use in the construction of the URI.
  | path | The path to use in the construction of the URI.
  | query | The query to use in the construction of the URI.
  | fragment | The fragment to use in the construction of the URI.

FUUri::FUUri | ( | Scheme | scheme,
|  | const fstring & | host,
|  | const fstring & | path = `FC("")`,
|  | const fstring & | fragment = `FC("")`
| ) |

  | Constructor. Parameters:
  | scheme | The scheme to use in the construction of the URI.
  | host | The host to use in the construction of the URI.
  | path | The path to use in the construction of the URI.
  | fragment | The fragment to use in the construction of the URI.

FUUri::FUUri | ( | const fstring & | path,
|  | const fstring & | fragment
| ) |

  | Constructor. Parameters:
  | path | The path to use in the construction of the URI.
  | fragment | The fragment to use in the construction of the URI.

## Member Function Documentation

static fstring FUUri::Escape | ( | const fstring & | path | ) | `[static]`

  | Escapes a path. Parameters:
  | path | A path.
Returns: The escaped path.

fstring FUUri::GetAbsolutePath | ( |  | ) | const

| Retrieves an absolute path from the URI. Returns: The URI absolute path.

fstring FUUri::GetAbsoluteUri | ( | bool | fragment = `true` | ) | const

  | Retrieves an absolute URI string from the URI. Parameters:
  | fragment | Whether to return a string with the fragment
Returns: The URI string.

fstring FUUri::GetAuthority | ( |  | ) | const

| Retrieves the authority string from the URI. ("[userInfo@]host[:port]") Returns: The URI authority string.

const fstring& FUUri::GetFragment | ( |  | ) | const`[inline]`

| Retrieves the fragment from the URI. Returns: The URI query.

const fstring& FUUri::GetHostname | ( |  | ) | const`[inline]`

| Retrieves the host information from the URI. Returns: The URI host.

const fstring& FUUri::GetPath | ( |  | ) | const`[inline]`

| Retrieves the path from the URI. Returns: The URI path.

uint32 FUUri::GetPort | ( |  | ) | const`[inline]`

| Retrieves the port number from the URI. Returns: The URI port number.

const fstring& FUUri::GetQuery | ( |  | ) | const`[inline]`

| Retrieves the query from the URI. Returns: The URI query.

fstring FUUri::GetRelativeUri | ( | const FUUri & | uri | ) | const

| Retrieves an relative URI string from the URI. Returns: The URI string.

Scheme FUUri::GetScheme | ( |  | ) | const`[inline]`

| Retrieves the scheme from the URI. Returns: The URI scheme.

const fstring& FUUri::GetSchemeDelimiter | ( |  | ) | const`[inline]`

| Retrieves the scheme delimiter from the URI. Returns: The URI scheme delimiter.

fstring FUUri::GetUserInformations | ( |  | ) | const

| Retrieves the user information from the URI. Returns: The URI user information.

bool FUUri::IsFile | ( |  | ) | const

| Retrieves whether this URI points to a file. Returns: Whether this URI points to a file.

void FUUri::MakeAbsolute | ( | FUUri & | uri | ) | const

  | Makes the passed in URI relative to this URI. Parameters:
  | uri | The relative or absolute URI

fstring FUUri::MakeAbsolute | ( | const fstring & | relativePath | ) | const

  | Makes an absolute path from a relative path and this URI. Parameters:
  | relpath | The relative path
Returns: The absolute path.

fstring FUUri::MakeRelative | ( | const fstring & | path | ) | const

  | Makes a relative path from a uri. Parameters:
  | uri | The uri representing the path.
Returns: The relative path.

FUUri FUUri::Resolve | ( | const fstring & | relativePath | ) | const

  | Resolves a URI from a relative path against this URI. Parameters:
  | relpath | The relative path.
Returns: The newly contructed URI.

void FUUri::SetFragment | ( | const fstring & | _fragment | ) | `[inline]`

  | Sets the fragment of the URI. Parameters:
  | _fragment | A URI fragment.

void FUUri::SetPort | ( | uint32 | _port | ) | `[inline]`

  | Sets the port number of the URI. Parameters:
  | _port | A valid port number.

void FUUri::SetQuery | ( | const fstring & | _query | ) | `[inline]`

  | Sets the query of the URI. Parameters:
  | _query | A URI fragment.

The documentation for this class was generated from the following file:

- FUtils/FUUri.h