DirectPrint/DirectPrintApp/src/directprintprinterdata.cpp
changeset 19 2275db202402
parent 11 613a5ff70823
equal deleted inserted replaced
2:acc370d7f2f6 19:2275db202402
       
     1 /*
       
     2 * Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "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 * Kanrikogaku Kenkyusho, Ltd. - Initial contribution
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include <s32strm.h>
       
    20 
       
    21 #include "directprintprinterdata.h"
       
    22 
       
    23 EXPORT_C void TDirectPrintPrinterData::InternalizeL(RReadStream& aStream)
       
    24 	{
       
    25 	iPrinterId = aStream.ReadInt32L();
       
    26 	TInt length = aStream.ReadInt32L();
       
    27 	if(length > 0)
       
    28 		{
       
    29 		aStream.ReadL(iPrinterName, length);
       
    30 		}
       
    31 	iPrinterDriver = TUid::Uid(aStream.ReadInt32L());
       
    32 	length = aStream.ReadInt32L();
       
    33 	if(length > 0)
       
    34 		{
       
    35 		aStream.ReadL(iDriverName, length);
       
    36 		}
       
    37 	iPrinterType = aStream.ReadInt32L();
       
    38 	length = aStream.ReadInt32L();
       
    39 	if(length > 0)
       
    40 		{
       
    41 		aStream.ReadL(iTypeName, length);
       
    42 		}
       
    43 	}
       
    44 
       
    45 EXPORT_C void TDirectPrintPrinterData::ExternalizeL(RWriteStream& aStream) const
       
    46 	{
       
    47 	aStream.WriteInt32L(iPrinterId);
       
    48 	aStream.WriteInt32L(iPrinterName.Length());
       
    49 	if (iPrinterName.Length() > 0)
       
    50 		{
       
    51 		aStream.WriteL(iPrinterName);
       
    52 		}
       
    53 	aStream.WriteInt32L(iPrinterDriver.iUid);
       
    54 	aStream.WriteInt32L(iDriverName.Length());
       
    55 	if (iDriverName.Length() > 0)
       
    56 		{
       
    57 		aStream.WriteL(iDriverName);
       
    58 		}
       
    59 	aStream.WriteInt32L(iPrinterType);
       
    60 	aStream.WriteInt32L(iTypeName.Length());
       
    61 	if (iTypeName.Length() > 0)
       
    62 		{
       
    63 		aStream.WriteL(iTypeName);
       
    64 		}
       
    65 	}
       
    66 
       
    67 EXPORT_C TDirectPrintPrinterData& TDirectPrintPrinterData::operator=(const TDirectPrintPrinterData& aData)
       
    68 	{
       
    69 	iPrinterId = aData.iPrinterId;
       
    70 	iPrinterName.Copy(aData.iPrinterName);
       
    71 	iPrinterDriver = aData.iPrinterDriver;
       
    72 	iDriverName.Copy(aData.iDriverName);
       
    73 	iPrinterType = aData.iPrinterType;
       
    74 	iTypeName.Copy(aData.iTypeName);
       
    75 	return *this;
       
    76 	}
       
    77