Update contrib.
2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * This contains constant definitions required by clients accessing the
16 * Content Access Framework.
27 #ifndef __CAFUTILS_H__
28 #define __CAFUTILS_H__
33 namespace ContentAccess
35 /** Provides static utility functions for the Content Access Framework*/
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
43 static HBufC* ReadDescriptor16L(RReadStream& aStream);
45 /** Utility function to write a descriptor to a stream
46 @param aStream The stream
47 @param aDescriptor The descriptor
49 static void WriteDescriptor16L(RWriteStream& aStream, const TDesC& aDescriptor);
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
55 static HBufC8* ReadDescriptor8L(RReadStream& aStream);
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
62 static void ReadDescriptor8L(RReadStream& aStream, TDes8& aBuffer);
64 /** Utility function to write a descriptor to a stream
65 @param aStream The stream
66 @param aDescriptor The descriptor
68 static void WriteDescriptor8L(RWriteStream& aStream, const TDesC8& aDescriptor);