# URI Class Reference

Encapsulation for an URI. More...

`#include <yateclass.h>`

Inheritance diagram for URI:

List of all members.

## Public Member Functions

| URI ()
| URI (const URI &uri)
| URI (const String &uri)
| URI (const char *uri)
| URI (const char *proto, const char *user, const char *host, int port=0, const char *desc=0)
void | parse () const
URI & | operator= (const URI &value)
URI & | operator= (const String &value)
URI & | operator= (const char *value)
const String & | getDescription () const
const String & | getProtocol () const
const String & | getUser () const
const String & | getHost () const
int | getPort () const

## Protected Member Functions

virtual void | changed ()

## Protected Attributes

bool | m_parsed
String | m_desc
String | m_proto
String | m_user
String | m_host
int | m_port

## Detailed Description

Encapsulation for an URI.

Uniform Resource Identifier encapsulation and parser. For efficiency reason the parsing is delayed as long as possible

## Constructor & Destructor Documentation

URI | ( |  | ) |

Empty URI constructor

URI | ( | const URI & | uri | ) |

Copy constructor

Parameters:

  | uri | Original URI to copy

URI | ( | const String & | uri | ) |

Constructor from a String that gets parsed later

Parameters:

  | uri | String form of the URI

URI | ( | const char * | uri | ) |

Constructor from a C string that gets parsed later

Parameters:

  | uri | String form of the URI

URI | ( | const char * | proto,
|  | const char * | user,
|  | const char * | host,
|  | int | port = `0`,
|  | const char * | desc = `0` |
| ) |  |  |

Constructor from URI components

Parameters:

  | proto | Protocol - something like "http", "sip", etc.
  | user | User component of the URI
  | host | Hostname component of the URI
  | port | Port part of the URI (optional)
  | desc | Description part in front of the URI (optional)

## Member Function Documentation

void parse | ( |  | ) | const

Calling this method ensures the string URI is parsed into components

URI& operator= | ( | const URI & | value | ) | `[inline]`

Assignment operator from URI

Parameters:

  | value | New URI value to assign

URI& operator= | ( | const String & | value | ) | `[inline]`

Assignment operator from String

Parameters:

  | value | New URI value to assign

Reimplemented from String.

URI& operator= | ( | const char * | value | ) | `[inline]`

Assignment operator from C string

Parameters:

  | value | New URI value to assign

Reimplemented from String.

const String& getDescription | ( |  | ) | const`[inline]`

Access method to the description part of the URI

Returns:
  Description part of the URI

const String& getProtocol | ( |  | ) | const`[inline]`

Access method to the protocol part of the URI

Returns:
  Protocol part of the URI

const String& getUser | ( |  | ) | const`[inline]`

Access method to the user part of the URI

Returns:
  User component of the URI

const String& getHost | ( |  | ) | const`[inline]`

Access method to the host part of the URI

Returns:
  Hostname part of the URI

int getPort | ( |  | ) | const`[inline]`

Access method to the port part of the URI

Returns:
  Port of the URI, zero if not set

virtual void changed | ( |  | ) | `[protected, virtual]`

Notification method called whenever the string URI has changed. The default behaviour is to invalidate the parsed flag and cal the method inherited from String.

Reimplemented from String.

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

- yateclass.h