Class KomodiaDNS::CDNSManager::
ParseAddress()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: operator =Next page: ParseMultithreaded    Show member index
Public Function Declared in:
DNSManager.h

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

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

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

Parse an address, convert it to DNS

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

try
{
    //Our address
    std::string sAddress;

    //Index count
    int iIndex=0;

    //Our last found position
    std::string::size_type iLastPosition;
    iLastPosition=0;

    //Our current position
    std::string::size_type iFoundPos;

    //Start parsing
    while ((iFoundPos=rAddress.find_first_of('.',iLastPosition))!=std::string::npos)
    {
        //Put the position in the new string
        sAddress+=(char)(iFoundPos-iLastPosition);

        //Add the partial string
        sAddress+=rAddress.substr(iLastPosition,
                                  iFoundPos-iLastPosition);

        //Set the last position to be the current
        iLastPosition=iFoundPos+1;
    }

    //Only if not null
    if (rAddress.length()!=iLastPosition)
    {
        //Insert the last part of the string
        sAddress+=(char)(rAddress.length()-iLastPosition);
        sAddress+=rAddress.substr(iLastPosition,
                                  rAddress.length()-iLastPosition);
    }

    //Done
    return sAddress;
}
ERROR_HANDLER_STATIC_RETURN(CDNSManager_Class,"ParseAddress",NULL)

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

Class Overview Class Overview  |  Public base class CErrorHandler  |  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.