![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cNetURL.h>
Public Member Functions | |
cNetURL (void) | |
cNetURL (const char *pszURL, DWORD dwFlags=0, NETSERVICE_TYPE eServiceType=NETSERVICE_UNDEF, NET_PORT_t wPort=k_NET_PORT_INVALID) | |
~cNetURL (void) | |
NET_PORT_t | get_Port () const |
void | SetEmpty () |
HRESULT | SetURL (const char *pszURL, DWORD dwFlags=0) |
HRESULT | SetObject (const char *pszObject) |
cStringA | get_URL () const |
UNITTEST_FRIEND (cNetURL) | |
Static Public Member Functions | |
static StrLen_t GRAYCALL | DeCode (char *pszDst, StrLen_t iDstMaxSize, const char *pszSrc, StrLen_t iSrcMaxSize=k_StrLen_UNK) |
static StrLen_t GRAYCALL | EnCode (char *pszDst, StrLen_t iDstMaxSize, const char *pszSrc, StrLen_t iSrcMaxSize=k_StrLen_UNK) |
static cStringA GRAYCALL | EnCode (const char *pszSrc, StrLen_t iSrcMaxSize=k_StrLen_UNK) |
static cStringA GRAYCALL | DeCode (const char *pszSrc, StrLen_t iSrcMaxSize=k_StrLen_UNK) |
Public Attributes | |
NETSERVICE_TYPE | m_eServiceType |
known prefix for service. AKA resource_type. e.g. NETSERVICE_http More... | |
cStringA | m_sUsername |
if supplied as part of the URL. More... | |
cStringA | m_sPassword |
if supplied as part of the URL. More... | |
cStringA | m_sServer |
domain/Hostname or IP. cNetAddrName::IsValidHostNameChar() More... | |
NET_PORT_t | m_wPort |
the port (ex.80 = default HTTP). k_NET_PORT_INVALID = 0 =use default for m_eServiceType. More... | |
cStringA | m_sObject |
"/dir/dir/object/object.ext" More... | |
cStringA | m_sExtra |
extra information/arguments (e.g. "?foo" or "#foo") More... | |
Static Public Attributes | |
static const StrLen_t | k_SizeMax = (k_NET_HOSTNAME_MAX + 1024) |
arbitrary max size. NI_MAXHOST + X More... | |
static const char | k_DirSep = '/' |
for URL's More... | |
static const char | k_ServiceSep [4] = "://" |
for URL's "://" More... | |
static const char | k_NetURLSafe [] = "$-_.+!*'()," "&:;?=/@" |
Known safe chars. NOTE: '+' has unknown compatibility status. More... | |
static const char | k_NetURLUnsafe [] = " <>\"#%{}|\\^~[]`" |
Known UNSAFE chars. More... | |
Protected Member Functions | |
void | SetObject2 (const char *pszObj) |
Parse/decompose a URL for all the known parts. Like: AfxParseURLEx( "service://user:password@server:port/dir/dir/object.ext?foo" ) similar to InternetCrackUrl( URL_COMPONENTS ) and .NET System.Uri
GrayLib::cNetURL::cNetURL | ( | void | ) |
GrayLib::cNetURL::cNetURL | ( | const char * | pszURL, |
DWORD | dwFlags = 0 , |
||
NETSERVICE_TYPE | eServiceType = NETSERVICE_UNDEF , |
||
NET_PORT_t | wPort = k_NET_PORT_INVALID |
||
) |
GrayLib::cNetURL::~cNetURL | ( | void | ) |
|
static |
Decode the odd HTML URL % encoding back to a normal string. iDstMaxSize includes room for '\0'
|
static |
|
static |
(RFC 1738, Dec. '94) Encode the odd HTML URL % encoding from a string. space = %20 etc. upper and lower case are the same. always ASCII 8 bit characters like "::InternetCanonicalizeUrl()"
|
static |
NET_PORT_t GrayLib::cNetURL::get_Port | ( | ) | const |
cStringA GrayLib::cNetURL::get_URL | ( | ) | const |
RE-Compose the URL from its parts.
void GrayLib::cNetURL::SetEmpty | ( | ) |
HRESULT GrayLib::cNetURL::SetObject | ( | const char * | pszObject | ) |
Set just the name of the object on the current m_sServer Allow setting of new server if it has a k_ServiceSep prefix
|
protected |
Set just the name of the object on the current m_sServer
HRESULT GrayLib::cNetURL::SetURL | ( | const char * | pszURL, |
DWORD | dwFlags = 0 |
||
) |
decompose/parse a URL string to its URL parts. Like: AfxParseURLEx( "service://user:password@server:port/dir/dir/object.ext" )
GrayLib::cNetURL::UNITTEST_FRIEND | ( | cNetURL | ) |
|
static |
for URL's
|
static |
Known safe chars. NOTE: '+' has unknown compatibility status.
|
static |
Known UNSAFE chars.
Known safe chars. NOTE: '+' has unknown compatibility status.
|
static |
for URL's "://"
Known UNSAFE chars.
|
static |
arbitrary max size. NI_MAXHOST + X
NETSERVICE_TYPE GrayLib::cNetURL::m_eServiceType |
known prefix for service. AKA resource_type. e.g. NETSERVICE_http
cStringA GrayLib::cNetURL::m_sExtra |
extra information/arguments (e.g. "?foo" or "#foo")
cStringA GrayLib::cNetURL::m_sObject |
"/dir/dir/object/object.ext"
cStringA GrayLib::cNetURL::m_sPassword |
if supplied as part of the URL.
cStringA GrayLib::cNetURL::m_sServer |
domain/Hostname or IP. cNetAddrName::IsValidHostNameChar()
cStringA GrayLib::cNetURL::m_sUsername |
if supplied as part of the URL.
NET_PORT_t GrayLib::cNetURL::m_wPort |
the port (ex.80 = default HTTP). k_NET_PORT_INVALID = 0 =use default for m_eServiceType.