![]() |
SerializeQuery() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Public Function |
Declared in: DNSQuery.h |
unsigned short SerializeQuery( char* pBuffer) const;
Serialize the buffer
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)
![]() |
Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003. |