Yate
Public Member Functions | Protected Member Functions | Protected Attributes

URI Class Reference

Encapsulation for an URI. More...

#include <yateclass.h>

Inheritance diagram for URI:
String GenObject

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
URIoperator= (const URI &value)
URIoperator= (const String &value)
URIoperator= (const char *value)
const StringgetDescription () const
const StringgetProtocol () const
const StringgetUser () const
const StringgetHost () const
int getPort () const
const StringgetExtra () const

Protected Member Functions

virtual void changed ()

Protected Attributes

bool m_parsed
String m_desc
String m_proto
String m_user
String m_host
String m_extra
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:
uriOriginal URI to copy
URI ( const String uri)

Constructor from a String that gets parsed later

Parameters:
uriString form of the URI
URI ( const char *  uri)

Constructor from a C string that gets parsed later

Parameters:
uriString 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:
protoProtocol - something like "http", "sip", etc.
userUser component of the URI
hostHostname component of the URI
portPort part of the URI (optional)
descDescription part in front of the URI (optional)

Member Function Documentation

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.

const String& getDescription ( ) const [inline]

Access method to the description part of the URI

Returns:
Description part of the URI
const String& getExtra ( ) const [inline]

Access method to the additional text part of the URI

Returns:
Additional text of the URI including the separator
const String& getHost ( ) const [inline]

Access method to the host part of the URI

Returns:
Hostname part of the URI

Referenced by MGCPEndpointId::set().

int getPort ( ) const [inline]

Access method to the port part of the URI

Returns:
Port of the URI, zero if not set

Referenced by MGCPEndpointId::set().

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

Referenced by MGCPEndpointId::set().

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

Assignment operator from C string

Parameters:
valueNew URI value to assign

Reimplemented from String.

References String::operator=().

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

Assignment operator from URI

Parameters:
valueNew URI value to assign

References String::operator=().

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

Assignment operator from String

Parameters:
valueNew URI value to assign

Reimplemented from String.

References String::operator=().

void parse ( ) const

Calling this method ensures the string URI is parsed into components


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