os/security/contentmgmt/contentaccessfwfordrm/source/cafutils/cafutils.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2004-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 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 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 * This contains constant definitions required by clients accessing the 
    16 * Content Access Framework.
    17 *
    18 */
    19 
    20 
    21 /**
    22  @file
    23  @internalComponent
    24  @released
    25 */
    26 
    27 #ifndef __CAFUTILS_H__
    28 #define __CAFUTILS_H__
    29 
    30 #include <e32std.h>
    31 #include <charconv.h>
    32 
    33 namespace ContentAccess
    34 	{
    35 	/** Provides static utility functions for the Content Access Framework*/
    36 	class TCafUtils
    37 		{
    38 	public:
    39 		/** Utility function to read a descriptor from a stream 
    40 		@param aStream The stream
    41 		@return An HBufC descriptor populated with the data from the stream
    42 		*/
    43 		static HBufC* ReadDescriptor16L(RReadStream& aStream);
    44 
    45 		/** Utility function to write a descriptor to a stream 
    46 		@param aStream The stream
    47 		@param aDescriptor The descriptor
    48 		*/
    49 		static void WriteDescriptor16L(RWriteStream& aStream, const TDesC& aDescriptor);
    50 
    51 		/** Utility function to read a descriptor from a stream 
    52 		@param aStream The stream
    53 		@return An HBufC descriptor populated with the data from the stream
    54 		*/
    55 		static HBufC8* ReadDescriptor8L(RReadStream& aStream);
    56 		
    57 		/** Utility function to read from a stream into an existing descriptor
    58 		@param aStream The stream
    59 		@param aBuffer Buffer to receive the data
    60 		@leave KErrOverflow If the buffer is not large enough to hold the descriptor
    61 		*/
    62 		static void ReadDescriptor8L(RReadStream& aStream, TDes8& aBuffer);
    63 
    64 		/** Utility function to write a descriptor to a stream 
    65 		@param aStream The stream
    66 		@param aDescriptor The descriptor
    67 		*/
    68 		static void WriteDescriptor8L(RWriteStream& aStream, const TDesC8& aDescriptor);
    69 		};
    70 	}
    71 #endif // __CAF_H__