2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: PosLmCategorySerialization class definition
19 #ifndef __EPOS_POSCATEGORYSERIALIZATION_H_
20 #define __EPOS_POSCATEGORYSERIALIZATION_H_
24 class CPosLandmarkCategory;
27 * This class contains helper methods for landmark category serialization.
28 * A landmark category can be packed into a buffer with PackL method and unpacked
29 * back with UnpackL method.
31 * @lib eposlandmarks.lib
34 class PosLmCategorySerialization
37 /** Packs category object into a buffer.
39 * All the data is preserved when packing. Database information is not stored.
40 * Packed category can be unpacked with @ref UnpackL method.
42 * @param aCategory The category to be packed.
43 * @return The buffer with the category data packed.
44 * Ownership is transferred to the client.
46 IMPORT_C static HBufC8* PackL( const CPosLandmarkCategory& aCategory );
48 /** Unpacks a category object, packed with @ref PackL method, from buffer.
50 * All the data is preserved when packing, and restored exactly
51 * when unpacking. It means that category ID is valid only for the database,
52 * this category was read from.
54 * @param aBuffer The buffer containing category.
55 * @return The category unpacked. Ownership is transferred to client.
56 * @leave KErrCorrupt if buffer does not contain valid category package.
58 IMPORT_C static CPosLandmarkCategory* UnpackL( const TDesC8& aBuffer );
61 #endif // __EPOS_POSCATEGORYSERIALIZATION_H_