![]() |
ParseAddress() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Public Function |
Declared in: DNSManager.h |
Declaration
static std::string ParseAddress(
const std::string& rAddress);
DescriptionParse an address, convert it to DNS
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
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. |