Class KomodiaDNS::CDNSQuery::
SerializeQuery()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: ParseNext page: Custom Code in Header After Includes    Show member index
Public Function Declared in:
DNSQuery.h

'Declaration' icon -- Shortcut to top of page. Declaration

unsigned short SerializeQuery(
    char* pBuffer) const;

'Description' icon -- Shortcut to top of page. Description

Serialize the buffer

'Function Body' icon -- Shortcut to top of page. 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' icon -- Shortcut to top of page. See Also

Class Overview Class Overview  |  Public base class CErrorHandler  |  Hierarchy Chart Hierarchy Chart


Get Surveyor!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.