Logo Search packages:      
Sourcecode: pwlib version File versions

PURL Class Reference

#include <url.h>

Inheritance diagram for PURL:

PObject

List of all members.


Detailed Description

This class describes a Universal Resource Locator. This is the desciption of a resource location as used by the World Wide Web and the PHTTPSocket# class.

Definition at line 148 of file url.h.


Comparison functions

enum  Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }
virtual Comparison CompareObjectMemoryDirect (const PObject &obj) const
bool operator!= (const PObject &obj) const
bool operator< (const PObject &obj) const
bool operator<= (const PObject &obj) const
bool operator== (const PObject &obj) const
bool operator> (const PObject &obj) const
bool operator>= (const PObject &obj) const

New functions for class.

enum  TranslationType { LoginTranslation, PathTranslation, QueryTranslation }
 Type for translation of strings to URL format,. More...
enum  UrlFormat { FullURL, PathOnly, URIOnly, HostPortOnly }
PFilePath AsFilePath () const
PString AsString (UrlFormat fmt=FullURL) const
const PStringGetFragment () const
 Get the fragment (##) field of the URL.
const PCaselessStringGetHostName () const
 Get the hostname field of the URL.
PString GetParameters () const
 Get the parameter (;) field of the URL.
const PStringToString & GetParamVars () const
 Get the parameter (;) field(s) of the URL as a string dictionary.
const PStringGetPassword () const
 Get the password field of the URL.
const PStringArray & GetPath () const
 Get the path field of the URL as a string array.
const PStringGetPathStr () const
 Get the path field of the URL as a string.
WORD GetPort () const
 Get the port field of the URL.
PString GetQuery () const
 Get the Query (?) field of the URL as a string.
const PStringToString & GetQueryVars () const
 Get the Query (?) field of the URL as a string dictionary.
BOOL GetRelativePath () const
 Get if path is relative or absolute.
const PCaselessStringGetScheme () const
 Get the scheme field of the URL.
const PStringGetUserName () const
 Get the username field of the URL.
BOOL IsEmpty () const
 Return TRUE if the URL is an empty string.
BOOL Parse (const PString &str, const char *defaultScheme=NULL)
BOOL Parse (const char *cstr, const char *defaultScheme=NULL)
void SetHostName (const PString &hostname)
 Set the hostname field of the URL.
void SetParameters (const PString &parameters)
 Set the parameter (;) field of the URL.
void SetParamVar (const PString &key, const PString &data)
 Set the parameter (;) field of the URL as a string dictionary.
void SetParamVars (const PStringToString &paramVars)
 Set the parameter (;) field(s) of the URL as a string dictionary.
void SetPassword (const PString &password)
 Set the password field of the URL.
void SetPath (const PStringArray &path)
 Set the path field of the URL as a string array.
void SetPathStr (const PString &pathStr)
 Set the path field of the URL as a string.
void SetPort (WORD newPort)
 Set the port field in the URL.
void SetQuery (const PString &query)
 Set the Query (?) field of the URL as a string.
void SetQueryVar (const PString &key, const PString &data)
 Set the Query (?) field of the URL as a string dictionary.
void SetQueryVars (const PStringToString &queryVars)
 Set the Query (?) field(s) of the URL as a string dictionary.
void SetScheme (const PString &scheme)
 Set the scheme field of the URL.
void SetUserName (const PString &username)
 Set the username field of the URL.
static BOOL OpenBrowser (const PString &url)
static void SplitQueryVars (const PString &queryStr, PStringToString &queryVars)
static PString TranslateString (const PString &str, TranslationType type)
static PString UntranslateString (const PString &str, TranslationType type)

Run Time Type functions

virtual const char * GetClass (unsigned=0) const
virtual BOOL InternalIsDescendant (const char *clsName) const
BOOL IsClass (const char *cls) const
static const char * Class ()

Public Member Functions

PString LegacyAsString (PURL::UrlFormat fmt, const PURLLegacyScheme *schemeInfo) const
BOOL LegacyParse (const PString &_url, const PURLLegacyScheme *schemeInfo)
 PURL (const PFilePath &path)
 PURL (const PString &str, const char *defaultScheme=NULL)
 PURL (const char *cstr, const char *defaultScheme=NULL)
 PURL ()
Miscellaneous functions
virtual PObjectClone () const
Overrides from class PObject
virtual Comparison Compare (const PObject &obj) const
virtual PINDEX HashFunction () const
virtual void PrintOn (ostream &strm) const
virtual void ReadFrom (istream &strm)

Protected Member Functions

virtual BOOL InternalParse (const char *cstr, const char *defaultScheme)
void Recalculate ()

Protected Attributes

PString fragment
PCaselessString hostname
PStringToString paramVars
PString password
PStringArray path
PString pathStr
WORD port
PStringToString queryVars
BOOL relativePath
PCaselessString scheme
PString urlString
PString username

Friends

I/O functions
ostream & operator<< (ostream &strm, const PObject &obj)
istream & operator>> (istream &strm, PObject &obj)

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

Generated by  Doxygen 1.6.0   Back to index