![]() |
GetAnswerParsed() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Public Function |
Declared in: DNSAnswers.h |
Declaration
std::string GetAnswerParsed(
BOOL bWindowsLines=TRUE,
BOOL bBrief=TRUE,
BOOL bExtraLine=FALSE) const;
DescriptionCreate a string of the answer bWindowsLines - Use window line seperator bBrief - Make the report brief bExtraLine - Add an extra line seperator in the end
Function Body
try
{
//Line terminator
//End of line
char aEndOfLine[3];
//Which is it
if (bWindowsLines)
{
aEndOfLine[0]=13;
aEndOfLine[1]=10;
aEndOfLine[2]=0;
}
else
{
aEndOfLine[0]='\n';
aEndOfLine[1]=0;
}
//Our string
std::string sAnswer;
//Iterate answers
for (int iCount=0;
iCount<m_aAnswers.size();
iCount++)
{
//What are we
if (iCount<m_aDNSHeader.usANCount &&
!iCount)
{
//Answer
sAnswer+="Non-authoritative answer:";
sAnswer+=aEndOfLine;
}
else if ((iCount<m_aDNSHeader.usANCount+
m_aDNSHeader.usNSCount) &&
iCount==m_aDNSHeader.usANCount)
{
//Authority servers
sAnswer+=aEndOfLine;
sAnswer+="Authoritive servers:";
sAnswer+=aEndOfLine;
}
else if (iCount==m_aDNSHeader.usANCount+
m_aDNSHeader.usNSCount)
{
//Additional records
sAnswer+=aEndOfLine;
sAnswer+="Additional records:";
sAnswer+=aEndOfLine;
}
//Add the answer
sAnswer+=m_aAnswers[iCount].GetAnswerParsed(bWindowsLines,
bBrief);
sAnswer+=aEndOfLine;
}
//Do we need another line?
if (bExtraLine)
sAnswer+=aEndOfLine;
//Done
return sAnswer;
}
ERROR_HANDLER_RETURN("GetAnswerParsed","")
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. |