CGopherLocator Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at CGopherLocator Class.

Gets a gopher "locator" from a gopher server, determines the locator's type, and makes the locator available to CGopherFileFind.

System_CAPS_ICON_note.jpg Note

The classes CGopherConnection, CGopherFile, CGopherFileFind, CGopherLocator and their members have been deprecated because they do not work on the Windows XP platform, but they will continue to work on earlier platforms.

class CGopherLocator : public CObject  

Public Constructors

NameDescription
CGopherLocator::CGopherLocatorConstructs a CGopherLocator object.

Public Methods

NameDescription
CGopherLocator::GetLocatorTypeParses a gopher locator and determines its attributes.

Public Operators

NameDescription
CGopherLocator::operator LPCTSTRDirectly accesses characters stored in a CGopherLocator object as a C-style string.

An application must get a gopher server's locator before it can retrieve information from that server. Once it has the locator, it must treat the locator as an opaque token.

Each gopher locator has attributes that determine the type of file or server found. See GetLocatorType for a list of types of gopher locators.

An application normally uses the locator for calls to CGopherFileFind::FindFile to retrieve a specific piece of information.

To learn more about how CGopherLocator works with the other MFC Internet classes, see the article Internet Programming with WinInet.

CObject

CGopherLocator

Header: afxinet.h

This member function is called to create a CGopherLocator object.

CGopherLocator(const CGopherLocator& ref);

Parameters

ref
A reference to a constant CGopherLocator object.

Remarks

You never create a CGopherLocator object directly. Instead, call CGopherConnection::CreateLocator to create and return a pointer to the CGopherLocator object.

Call this member function to get the locator type.

BOOL GetLocatorType(DWORD& dwRef) const;  

Parameters

dwRef
A reference to a DWORD that will receive the locator type. See Remarks for a table of locator types.

Return Value

Nonzero if successful; otherwise 0. If the call fails, the Win32 function GetLastError may be called to determine the cause of the error.

Remarks

The possible types are as follows:

ValueMeaning
GOPHER_TYPE_TEXT_FILEAn ASCII text file.
GOPHER_TYPE_DIRECTORYA directory of additional Gopher items.
GOPHER_TYPE_CSOA CSO phone book server.
GOPHER_TYPE_ERRORIndicates an error condition.
GOPHER_TYPE_MAC_BINHEXA Macintosh file in BINHEX format.
GOPHER_TYPE_DOS_ARCHIVEA DOS archive file.
GOPHER_TYPE_UNIX_UUENCODEDA UUENCODED file.
GOPHER_TYPE_INDEX_SERVERAn index server.
GOPHER_TYPE_TELNETA Telnet Server.
GOPHER_TYPE_BINARYA binary file.
GOPHER_TYPE_REDUNDANTA duplicated server. The information contained within is a duplicate of the primary server. The primary server is the last directory entry that did not have a GOPHER_TYPE_REDUNDANT type.
GOPHER_TYPE_TN3270A TN3270 server.
GOPHER_TYPE_GIFA GIF graphics file.
GOPHER_TYPE_IMAGEAn image file.
GOPHER_TYPE_BITMAPA bitmap file.
GOPHER_TYPE_MOVIEA movie file.
GOPHER_TYPE_SOUNDA sound file.
GOPHER_TYPE_HTMLAn HTML document.
GOPHER_TYPE_PDFA PDF file.
GOPHER_TYPE_CALENDARA calendar file.
GOPHER_TYPE_INLINEAn inline file.
GOPHER_TYPE_UNKNOWNThe item type is unknown.
GOPHER_TYPE_ASKAn Ask+ item.
GOPHER_TYPE_GOPHER_PLUSA Gopher+ item.

This useful casting operator provides an efficient method to access the null-terminated C string contained in a CGopherLocator object.

operator LPCTSTR () const;  

Return Value

A character pointer to the string's data.

Remarks

No characters are copied; only a pointer is returned.

CObject Class
Hierarchy Chart
CGopherFileFind Class

Show: