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.

class CUrl

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

See Also

Other Resources

CUrl Members

ATL Classes