zeroconf/dnsparser/src/cdnsquestion.cpp
changeset 14 da856f45b798
equal deleted inserted replaced
12:78fbd574edf4 14:da856f45b798
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "CDnsQuestion.h"
       
    20 
       
    21 
       
    22 EXPORT_C CDnsQuestion* CDnsQuestion::NewL()
       
    23 	{
       
    24 	return (new(ELeave) CDnsQuestion());
       
    25     }
       
    26 
       
    27 CDnsQuestion::CDnsQuestion():CDnsSection()
       
    28 	{
       
    29 	
       
    30 	}
       
    31 
       
    32 EXPORT_C CDnsQuestion::~CDnsQuestion()
       
    33 	{	
       
    34 	}
       
    35 
       
    36 EXPORT_C TBool CDnsQuestion::IsUnicast()const
       
    37 	{
       
    38 	if(iClass & KQueryBit)
       
    39 		return ETrue;
       
    40 	else
       
    41 		return EFalse;
       
    42 	}
       
    43 
       
    44 EXPORT_C void CDnsQuestion::SetUnicast(TBool )
       
    45 	{
       
    46 	iClass |= KQueryBit;
       
    47 	}
       
    48 
       
    49 EXPORT_C TUint16 CDnsQuestion::Size()const
       
    50 	{
       
    51 	TUint16 count = 0;
       
    52 	count += iName.Size();
       
    53 	count += 2; // 2 bytes = descriptor length+ 0 length octet at the end
       
    54 	count += sizeof(iType);
       
    55 	count += sizeof(iClass);
       
    56 	return count;
       
    57 	}