|
1 /* |
|
2 * Copyright (c) 2006 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: PosLandmarkSerialization class definition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __EPOS_POSLANDMARKSERIALIZATION_H |
|
20 #define __EPOS_POSLANDMARKSERIALIZATION_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 class CPosLandmark; |
|
25 |
|
26 /** |
|
27 * This class contains helper methods for landmark serialization. |
|
28 * A landmark can be packed into a buffer with PackL method and unpacked |
|
29 * back with UnpackL method. |
|
30 * |
|
31 * @lib eposlandmarks.lib |
|
32 * @since S60 3.1 |
|
33 */ |
|
34 class PosLandmarkSerialization |
|
35 { |
|
36 public: |
|
37 /** Packs landmark object into a buffer. |
|
38 * |
|
39 * All the data is preserved when packing. Database information is not stored. |
|
40 * Packed landmark can be unpacked with @ref UnpackL method. |
|
41 * |
|
42 * @param aLandmark The landmark to be packed. |
|
43 * @return The buffer with the landmark data packed. |
|
44 * Ownership is transferred to the client. |
|
45 */ |
|
46 IMPORT_C static HBufC8* PackL( const CPosLandmark& aLandmark ); |
|
47 |
|
48 /** Unpacks a landmark object, packed with @ref PackL method, from buffer. |
|
49 * |
|
50 * All the data is preserved when packing, and restored exactly |
|
51 * when unpacking. It means that landmark ID and |
|
52 * category IDs are valid only for the database, this landmark was read from. |
|
53 * |
|
54 * @param aBuffer The buffer containing landmark. |
|
55 * @return The landmark unpacked. Ownership is transferred to client. |
|
56 * @leave KErrCorrupt if buffer does not contain valid landmark package. |
|
57 */ |
|
58 IMPORT_C static CPosLandmark* UnpackL( const TDesC8& aBuffer ); |
|
59 }; |
|
60 |
|
61 #endif // __EPOS_POSLANDMARKSERIALIZATION_H |