![]() |
SerializeQuery() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Public Function |
Declared in: DNSQuery.h |
Declaration
unsigned short SerializeQuery(
char* pBuffer) const;
DescriptionSerialize the buffer
Function Body
try
{
//Our size counter
unsigned short usSize;
usSize=0;
//Iterate the vector
QueryVector::const_iterator aIterator;
aIterator=m_aQueries.begin();
//Start the loop
while (aIterator!=m_aQueries.end())
{
//Calculate the struct size
usSize+=aIterator->sName.length()+1;
usSize+=sizeof(unsigned short)*2;
//Copy the string
memcpy(pBuffer,
aIterator->sName.c_str(),
aIterator->sName.length());
pBuffer+=aIterator->sName.length();
//Terminating null
*pBuffer=0;
pBuffer++;
//Copy the data
//Type
memcpy(pBuffer,
&aIterator->usType,
sizeof(aIterator->usType));
pBuffer+=sizeof(unsigned short);
//Class
memcpy(pBuffer,
&aIterator->usClass,
sizeof(aIterator->usClass));
pBuffer+=sizeof(unsigned short);
//Next data
++aIterator;
}
//Done
return usSize;
}
ERROR_HANDLER_RETURN("SerializeQuery",0)
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. |