pkiutilities/DeviceToken/Inc/DevTokenNullStream.h
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2006 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:   The header file of DevTokenNullStream
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __DEVTOKENNULLSTREAM_H__
       
    21 #define __DEVTOKENNULLSTREAM_H__
       
    22 
       
    23 #include <s32strm.h>
       
    24 #include <s32buf.h>
       
    25 
       
    26 /**
       
    27  * Implementation of the MStreamBuf interface that throws away all data written
       
    28  * to it.  It does not support reading
       
    29  *
       
    30  *  @lib DevTokenShared.dll
       
    31  *  @since S60 v3.2.
       
    32  */
       
    33 class TNullBuf : public MStreamBuf
       
    34     {
       
    35     public:
       
    36     
       
    37         TNullBuf();
       
    38     
       
    39         TUint BytesWritten();
       
    40         
       
    41     private:
       
    42     
       
    43         virtual void DoWriteL(const TAny* aPtr,TInt aLength);
       
    44         
       
    45     private:
       
    46     
       
    47         TUint iBytesWritten;
       
    48     }; 
       
    49 
       
    50 
       
    51 /**
       
    52  * A write stream that throws away all its input, but keeps track of how many
       
    53  * bytes have been written to it.  It is used for determining the amount of
       
    54  * memory needed to store externalised objects.
       
    55  * 
       
    56  *  @lib DevTokenShared.dll
       
    57  *  @since S60 v3.2.
       
    58  */
       
    59 class RNullWriteStream : public RWriteStream
       
    60     {
       
    61     public:
       
    62         RNullWriteStream();
       
    63         TUint BytesWritten();
       
    64     
       
    65     private:
       
    66         TNullBuf iSink;
       
    67     };
       
    68 
       
    69 #endif //__DEVTOKENNULLSTREAM_H__
       
    70 
       
    71 //EOF
       
    72