Class CWhoisSocket::
GetAddressForWhois()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: GetAdditionalWhoisServerNext page: GetLastTarget    Show member index
Public Function Declared in:
WhoisSocket.h

'Declaration' icon -- Shortcut to top of page. Declaration

static std::string GetAddressForWhois(
    const std::string& rAddress);

'Description' icon -- Shortcut to top of page. Description

Get an address for whois

'Function Body' icon -- Shortcut to top of page. Function Body

try
{
    //Get the vector
    AddressVector aVector;
    aVector=AnalyzeAddress(rAddress);

    //Do we have data
    if (aVector.begin()==aVector.end())
        return "";

    //Get the iterator
    AddressVector::const_iterator aIterator;
    aIterator=aVector.begin();

    //Our address
    std::string sAddress;
    std::string sAddAddress;

    //Get the first one
    sAddress+=*aIterator;

    //Do we have the second one ?
    ++aIterator;
    if (aIterator==aVector.end())
        return "";

    //Add it
    sAddAddress=*aIterator;
    sAddAddress+='.';
    sAddAddress+=sAddress;

    //What type is it
    if (!(*aIterator=="COM" ||
          *aIterator=="NET" ||
          *aIterator=="ORG" ||
          *aIterator=="MIL" ||
          *aIterator=="EDU" ||
          *aIterator=="CO") ||
          sAddress.length()==3)
        //Done
        return sAddAddress;

    //Another sub address
    ++aIterator;
    if (aIterator==aVector.end())
        return "";

    //This is the final address
    sAddress=*aIterator;
    sAddress+='.';
    sAddress+=sAddAddress;

    //Done
    return sAddress;
}
ERROR_HANDLER_STATIC_RETURN(CWhoisSocket_Class,"GetAddressForWhois","")

'See Also' icon -- Shortcut to top of page. See Also

Class Overview Class Overview  |  Public base class CTCPSocketAsync  |  Hierarchy Chart Hierarchy Chart


Get Surveyor!This web site was generated using Surveyor V4.50.811.1.  Click here for more information. Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003.