Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

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

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

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& 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

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

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

Assignment operator from C string

Parameters:
value New URI value to assign

Reimplemented from String.

URI& operator= const String value  )  [inline]
 

Assignment operator from String

Parameters:
value New URI value to assign

Reimplemented from String.

URI& operator= const URI value  )  [inline]
 

Assignment operator from URI

Parameters:
value New URI value to assign

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:
Generated on Fri Jul 7 03:11:38 2006 for Yate by  doxygen 1.4.4