|
1 /* |
|
2 * Copyright (c) 2002 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 * Wrapper functions and classes for cXmlLibrary (NW_...) functionality. |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef NW_UTIL_H |
|
22 #define NW_UTIL_H |
|
23 |
|
24 // INCLUDES |
|
25 |
|
26 #include <e32base.h> |
|
27 #include <nwx_status.h> |
|
28 #include <nw_wbxml_dictionary.h> |
|
29 #include <nw_encoder_stringtable.h> |
|
30 #include <nw_string_string.h> |
|
31 |
|
32 // FUNCTION DECLARATION |
|
33 |
|
34 /** |
|
35 * Convert cXML status code to Symbian OS error code. |
|
36 * @param aNwError cXML status. |
|
37 * @return Symbian OS error code. |
|
38 */ |
|
39 TInt NwStatus2Error( NW_Status_t aNwStatus ); |
|
40 |
|
41 /** |
|
42 * Leave if cXML status is error status. |
|
43 * @param aNwError cXML status. |
|
44 * @return aNwStatus. |
|
45 */ |
|
46 inline TInt LeaveIfNwErrorL( NW_Status_t aNwStatus ); |
|
47 |
|
48 /** |
|
49 * Push a cleanup operation for an NW_Ucs2* buffer on the cleanup stack. |
|
50 * @param aUcs2 The buffer to be cleaned up. |
|
51 */ |
|
52 void CleanupNwUcs2PushL( NW_Ucs2* aUcs2 ); |
|
53 |
|
54 /** |
|
55 * Push a cleanup operation for a NW_String_t storage. Cleanup operation |
|
56 * calls NW_String_deleteStorage(), but does not delete aString. |
|
57 */ |
|
58 void CleanupNwStringStoragePushL( NW_String_t* aString ); |
|
59 |
|
60 // CLASS DECLARATION |
|
61 |
|
62 /** |
|
63 * Encapsulate WBXML dictionary initialization. |
|
64 */ |
|
65 NONSHARABLE_CLASS( RNwWbxmlDictionary ) |
|
66 { |
|
67 public: // New methods |
|
68 |
|
69 /** |
|
70 * Initialize dictionary. |
|
71 * @param aCount Dictionary array count. |
|
72 * @param aDictArray Dictionary array. |
|
73 * @return Error code. |
|
74 */ |
|
75 TInt Initialize |
|
76 ( NW_Int32 aCount, NW_WBXML_Dictionary_t* aDictArray[] ); |
|
77 |
|
78 /** |
|
79 * Destroy dictionary. |
|
80 */ |
|
81 void Close(); |
|
82 }; |
|
83 |
|
84 /** |
|
85 * Encapsulate a WBXML document node. |
|
86 */ |
|
87 NONSHARABLE_CLASS( CNwDomDocumentNode ): public CBase |
|
88 { |
|
89 public: // Constructors and destructor |
|
90 |
|
91 /** |
|
92 * Constructor. |
|
93 */ |
|
94 inline CNwDomDocumentNode(); |
|
95 |
|
96 /** |
|
97 * Destructor. |
|
98 */ |
|
99 virtual ~CNwDomDocumentNode(); |
|
100 |
|
101 public: // Data |
|
102 |
|
103 NW_DOM_DocumentNode_t* iDocNode; ///< The document node. Owned. |
|
104 }; |
|
105 |
|
106 #include "NwUtil.inl" |
|
107 |
|
108 #endif /* def NW_UTIL_H */ |