os/security/contentmgmt/contentaccessfwfordrm/source/cafutils/cafutils.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/contentmgmt/contentaccessfwfordrm/source/cafutils/cafutils.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,71 @@
     1.4 +/*
     1.5 +* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of the License "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +* This contains constant definitions required by clients accessing the 
    1.19 +* Content Access Framework.
    1.20 +*
    1.21 +*/
    1.22 +
    1.23 +
    1.24 +/**
    1.25 + @file
    1.26 + @internalComponent
    1.27 + @released
    1.28 +*/
    1.29 +
    1.30 +#ifndef __CAFUTILS_H__
    1.31 +#define __CAFUTILS_H__
    1.32 +
    1.33 +#include <e32std.h>
    1.34 +#include <charconv.h>
    1.35 +
    1.36 +namespace ContentAccess
    1.37 +	{
    1.38 +	/** Provides static utility functions for the Content Access Framework*/
    1.39 +	class TCafUtils
    1.40 +		{
    1.41 +	public:
    1.42 +		/** Utility function to read a descriptor from a stream 
    1.43 +		@param aStream The stream
    1.44 +		@return An HBufC descriptor populated with the data from the stream
    1.45 +		*/
    1.46 +		static HBufC* ReadDescriptor16L(RReadStream& aStream);
    1.47 +
    1.48 +		/** Utility function to write a descriptor to a stream 
    1.49 +		@param aStream The stream
    1.50 +		@param aDescriptor The descriptor
    1.51 +		*/
    1.52 +		static void WriteDescriptor16L(RWriteStream& aStream, const TDesC& aDescriptor);
    1.53 +
    1.54 +		/** Utility function to read a descriptor from a stream 
    1.55 +		@param aStream The stream
    1.56 +		@return An HBufC descriptor populated with the data from the stream
    1.57 +		*/
    1.58 +		static HBufC8* ReadDescriptor8L(RReadStream& aStream);
    1.59 +		
    1.60 +		/** Utility function to read from a stream into an existing descriptor
    1.61 +		@param aStream The stream
    1.62 +		@param aBuffer Buffer to receive the data
    1.63 +		@leave KErrOverflow If the buffer is not large enough to hold the descriptor
    1.64 +		*/
    1.65 +		static void ReadDescriptor8L(RReadStream& aStream, TDes8& aBuffer);
    1.66 +
    1.67 +		/** Utility function to write a descriptor to a stream 
    1.68 +		@param aStream The stream
    1.69 +		@param aDescriptor The descriptor
    1.70 +		*/
    1.71 +		static void WriteDescriptor8L(RWriteStream& aStream, const TDesC8& aDescriptor);
    1.72 +		};
    1.73 +	}
    1.74 +#endif // __CAF_H__