CUrl Class
This class represents a URL. It allows you to manipulate each element of the URL independently of the others whether parsing an existing URL string or building a string from scratch.
Important
This class and its members cannot be used in applications that execute in the Windows Runtime.
class CUrl
Members
Public Constructors
Name |
Description |
---|---|
The constructor. |
|
The destructor. |
Public Methods
Name |
Description |
---|---|
Call this method to convert the URL string to canonical form. |
|
Call this method to clear all of the URL fields. |
|
Call this method to decode and parse the URL. |
|
Call this method to create the URL. |
|
Call this method to get extra information (such as ?text or #text) from the URL. |
|
Call this method to get the length of the extra information (such as ?text or #text) to retrieve from the URL. |
|
Call this method to get the host name from the URL. |
|
Call this method to get the length of the host name. |
|
Call this method to get the password from the URL. |
|
Call this method to get the length of the password. |
|
Call this method to get the port number in terms of ATL_URL_PORT. |
|
Call this method to get the URL scheme. |
|
Call this method to get the URL scheme name. |
|
Call this method to get the length of the URL scheme name. |
|
Call this method to get the URL length. |
|
Call this method to get the URL path. |
|
Call this method to get the URL path length. |
|
Call this method to get the user name from the URL. |
|
Call this method to get the length of the user name. |
|
Call this method to set the extra information (such as ?text or #text) of the URL. |
|
Call this method to set the host name. |
|
Call this method to set the password. |
|
Call this method to set the port number in terms of ATL_URL_PORT. |
|
Call this method to set the URL scheme. |
|
Call this method to set the URL scheme name. |
|
Call this method to set the URL path. |
|
Call this method to set the user name. |
Public Operators
Name |
Description |
---|---|
Assigns the specified CUrl object to the current CUrl object. |
Remarks
CUrl allows you to manipulate the fields of a URL, such as the path or port number. CUrl understands URLs of the following form:
<Scheme>://<UserName>:<Password>@<HostName>:<PortNumber>/<UrlPath><ExtraInfo>
(Some fields are optional.) For example, consider this URL:
https://someone:secret@www.microsoft.com:80/visualc/stuff.htm#contents
CUrl::CrackUrl parses it as follows:
Scheme: "http" or ATL_URL_SCHEME_HTTP
UserName: "someone"
Password: "secret"
HostName: "www.microsoft.com"
PortNumber: 80
UrlPath: "visualc/stuff.htm"
ExtraInfo: "#contents"
To manipulate the UrlPath field (for instance), you would use GetUrlPath, GetUrlPathLength, and SetUrlPath. You would use CreateUrl to create the complete URL string.
Requirements
Header: atlutil.h