|
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 |
|
23 /** |
|
24 @file |
|
25 @internalComponent |
|
26 @released |
|
27 */ |
|
28 |
|
29 #ifndef __CAFUTILS_H__ |
|
30 #define __CAFUTILS_H__ |
|
31 |
|
32 #include <e32std.h> |
|
33 #include <charconv.h> |
|
34 |
|
35 namespace ContentAccess |
|
36 { |
|
37 /** Provides static utility functions for the Content Access Framework*/ |
|
38 class TCafUtils |
|
39 { |
|
40 public: |
|
41 /** Utility function to read a descriptor from a stream |
|
42 @param aStream The stream |
|
43 @return An HBufC descriptor populated with the data from the stream |
|
44 */ |
|
45 static HBufC* ReadDescriptor16L(RReadStream& aStream); |
|
46 |
|
47 /** Utility function to write a descriptor to a stream |
|
48 @param aStream The stream |
|
49 @param aDescriptor The descriptor |
|
50 */ |
|
51 static void WriteDescriptor16L(RWriteStream& aStream, const TDesC& aDescriptor); |
|
52 |
|
53 /** Utility function to read a descriptor from a stream |
|
54 @param aStream The stream |
|
55 @return An HBufC descriptor populated with the data from the stream |
|
56 */ |
|
57 static HBufC8* ReadDescriptor8L(RReadStream& aStream); |
|
58 |
|
59 /** Utility function to read from a stream into an existing descriptor |
|
60 @param aStream The stream |
|
61 @param aBuffer Buffer to receive the data |
|
62 @leave KErrOverflow If the buffer is not large enough to hold the descriptor |
|
63 */ |
|
64 static void ReadDescriptor8L(RReadStream& aStream, TDes8& aBuffer); |
|
65 |
|
66 /** Utility function to write a descriptor to a stream |
|
67 @param aStream The stream |
|
68 @param aDescriptor The descriptor |
|
69 */ |
|
70 static void WriteDescriptor8L(RWriteStream& aStream, const TDesC8& aDescriptor); |
|
71 }; |
|
72 } |
|
73 #endif // __CAF_H__ |