|
1 /* |
|
2 * Copyright (c) 2004 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 "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: Serialization tools for SAP Settings Store. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __IMPSSAPSERIALIZER_H |
|
19 #define __IMPSSAPSERIALIZER_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <s32strm.h> |
|
23 #include <s32buf.h> |
|
24 |
|
25 // CLASS DECLARATION |
|
26 /** |
|
27 * Buffer etc. serialization tools. |
|
28 */ |
|
29 NONSHARABLE_CLASS( IMPSSAPSerializer ) |
|
30 { |
|
31 public: // New methods |
|
32 |
|
33 /** |
|
34 * Externalizes the given buffer to given write stream. |
|
35 * Preserves NULL pointers. |
|
36 * |
|
37 * @since 3.0 |
|
38 * @param aBuffer Buffer to stream. Buffer can be NULL. |
|
39 * @param aStream Destination stream. |
|
40 */ |
|
41 static void ExternalizeBufferL( const HBufC* aBuffer, RWriteStream& aStream ); |
|
42 |
|
43 |
|
44 /** |
|
45 * Internalizes buffer from stream. |
|
46 * |
|
47 * @since 3.0 |
|
48 * @param aStream The stream to read to. |
|
49 * @return Internalized buffer. If externalized buffer was |
|
50 * NULL or zero length, NULL pointer is returned. |
|
51 */ |
|
52 static HBufC* InternalizeBufferL( RReadStream& aStream ); |
|
53 |
|
54 /** |
|
55 * Returns the serialized size of passed buffer. |
|
56 * (As space is needed by the ExternalizeBufferL(). ) |
|
57 * |
|
58 * @since 3.0 |
|
59 * @param aBuffer The buffer which stream consumption |
|
60 * to get. |
|
61 * @return The serialized size. Returned size is |
|
62 * rounded up approximation. |
|
63 */ |
|
64 static TInt BufferSizeInBytes( const HBufC* aBuffer ); |
|
65 |
|
66 |
|
67 private: // Prohibited constructor & destructor |
|
68 |
|
69 IMPSSAPSerializer(); |
|
70 ~IMPSSAPSerializer(); |
|
71 |
|
72 }; |
|
73 |
|
74 #endif // __IMPSSAPSERIALIZER_H |
|
75 |
|
76 // End of File |