contextframework/cfw/inc/cfservices/cfserviceutils.h
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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:  CFServer utils
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CFSERVICEUTILS_H
       
    20 #define CFSERVICEUTILS_H
       
    21 
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 class RWriteStream;
       
    26 class RReadStream;
       
    27 
       
    28 /**
       
    29 * Context Framework Services utils class.
       
    30 */
       
    31 NONSHARABLE_CLASS( CFServiceUtils )
       
    32     {
       
    33     public:
       
    34     
       
    35         /**
       
    36         * Updates buffer with new data.
       
    37         * Creates a new buffer if needed.
       
    38         * 
       
    39         * @since S60 5.0
       
    40         * @param aBuffer Buffer where to copy.
       
    41         * @param aNewData New data what to copy.
       
    42         * @return None.
       
    43         */
       
    44         static void UpdateBufferL( HBufC*& aBuffer, const TDesC& aNewData );
       
    45 
       
    46         /**
       
    47         * Writes descriptor into stream.
       
    48         * First is written descriptor length and then the descriptor itself.
       
    49         * 
       
    50         * @since S60 5.0
       
    51         * @param aDesc Descriptor to write into stream.
       
    52         * @param aStream Write stream to do the writing.
       
    53         * @return None.
       
    54         */
       
    55         static void WriteIntoStreamL( const HBufC* const aBuf, RWriteStream& aStream );
       
    56 
       
    57         /**
       
    58         * Read from stream into descriptor.
       
    59         * First is read descriptor length and then the descriptor itself.
       
    60         * 
       
    61         * @since S60 5.0
       
    62         * @param aDesc Descriptor to write into stream.
       
    63         * @param aStream Write stream to do the writing.
       
    64         * @return None.
       
    65         */
       
    66         static void ReadFromStreamL( HBufC*& aBuffer, RReadStream& aStream );
       
    67     };
       
    68 
       
    69 #endif