![]() |
AnalyzeAddress() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Public Function |
Declared in: WhoisSocket.h |
Declarationstatic CWhoisSocket::AddressVector AnalyzeAddress( const std::string& rAddress);
DescriptionBreak an address
Function Body
//Our vector
AddressVector aVector;
//Do we have data in the string
if (!rAddress.length())
{
//Report it
ReportStaticError(CWhoisSocket_Class,"AnalyzeAddress","Recieved empty string!");
//Exit
return aVector;
}
try
{
//Copy the string to a tmp buffer
std::string sTmp;
sTmp=rAddress;
//Get the last part of the address
std::string::size_type aPos;
aPos=sTmp.find_last_of('.');
//Do we have it
while (aPos!=std::string::npos)
{
//How much to copy
int iCopySize;
iCopySize=sTmp.length()-aPos-1;
//Allocate the buffer
char* pExtension;
pExtension=new char[iCopySize+1];
//Take it
std::string::size_type aCopied;
aCopied=sTmp.copy(pExtension,iCopySize,aPos+1);
pExtension[aCopied]=0;
//Convert it to upper case
strupr(pExtension);
//Put it in a string
std::string sData;
sData=pExtension;
//Put inside the vector
aVector.push_back(sData);
//Done with the buffer
delete [] pExtension;
//Cut the string
sTmp=sTmp.substr(0,aPos);
//Get the last part of the address
aPos=sTmp.find_last_of('.');
}
//Insert this string
aVector.push_back(sTmp);
//Done
return aVector;
}
ERROR_HANDLER_STATIC_RETURN(CWhoisSocket_Class,"AnalyzeAddress",aVector)
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. |