sl@0: /* sl@0: * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * This contains constant definitions required by clients accessing the sl@0: * Content Access Framework. sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @internalComponent sl@0: @released sl@0: */ sl@0: sl@0: #ifndef __CAFUTILS_H__ sl@0: #define __CAFUTILS_H__ sl@0: sl@0: #include sl@0: #include sl@0: sl@0: namespace ContentAccess sl@0: { sl@0: /** Provides static utility functions for the Content Access Framework*/ sl@0: class TCafUtils sl@0: { sl@0: public: sl@0: /** Utility function to read a descriptor from a stream sl@0: @param aStream The stream sl@0: @return An HBufC descriptor populated with the data from the stream sl@0: */ sl@0: static HBufC* ReadDescriptor16L(RReadStream& aStream); sl@0: sl@0: /** Utility function to write a descriptor to a stream sl@0: @param aStream The stream sl@0: @param aDescriptor The descriptor sl@0: */ sl@0: static void WriteDescriptor16L(RWriteStream& aStream, const TDesC& aDescriptor); sl@0: sl@0: /** Utility function to read a descriptor from a stream sl@0: @param aStream The stream sl@0: @return An HBufC descriptor populated with the data from the stream sl@0: */ sl@0: static HBufC8* ReadDescriptor8L(RReadStream& aStream); sl@0: sl@0: /** Utility function to read from a stream into an existing descriptor sl@0: @param aStream The stream sl@0: @param aBuffer Buffer to receive the data sl@0: @leave KErrOverflow If the buffer is not large enough to hold the descriptor sl@0: */ sl@0: static void ReadDescriptor8L(RReadStream& aStream, TDes8& aBuffer); sl@0: sl@0: /** Utility function to write a descriptor to a stream sl@0: @param aStream The stream sl@0: @param aDescriptor The descriptor sl@0: */ sl@0: static void WriteDescriptor8L(RWriteStream& aStream, const TDesC8& aDescriptor); sl@0: }; sl@0: } sl@0: #endif // __CAF_H__