1 /* |
|
2 * Copyright (c) 2000 - 2001 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 * |
|
16 */ |
|
17 |
|
18 |
|
19 /** ----------------------------------------------------------------------- ** |
|
20 @package: NW_XML |
|
21 |
|
22 @synopsis: default |
|
23 |
|
24 @description: default |
|
25 |
|
26 ** ----------------------------------------------------------------------- **/ |
|
27 |
|
28 #ifndef NW_XMLP2WBXML_H |
|
29 #define NW_XMLP2WBXML_H |
|
30 |
|
31 #include <xml/cxml/nw_xmlp_xmlreader.h> |
|
32 |
|
33 #ifdef __cplusplus |
|
34 extern "C" { |
|
35 #endif /* __cplusplus */ |
|
36 |
|
37 |
|
38 /** ----------------------------------------------------------------------- ** |
|
39 @function: NW_Xml_Text2WbxmlEncoder_New |
|
40 |
|
41 @synopsis: Constructor. |
|
42 |
|
43 @scope: public |
|
44 |
|
45 @parameters: |
|
46 [in] NW_Uint32 publicID |
|
47 The public ID. |
|
48 |
|
49 [in] NW_Uint32 encoding |
|
50 The encoding. |
|
51 |
|
52 [out] void** ppV |
|
53 The returned structure. |
|
54 |
|
55 @description: Constructor. |
|
56 |
|
57 @returns: NW_Status_t |
|
58 Status of operation. |
|
59 |
|
60 ** ----------------------------------------------------------------------- **/ |
|
61 NW_Status_t |
|
62 NW_XML_Text2WbxmlEncoder_New(NW_Uint32 publicID, NW_Uint32 encoding, void** ppV); |
|
63 |
|
64 |
|
65 /** ----------------------------------------------------------------------- ** |
|
66 @function: NW_XML_XmlpWbxmlEncoder_Delete |
|
67 |
|
68 @synopsis: Destructor. |
|
69 |
|
70 @scope: public |
|
71 |
|
72 @parameters: |
|
73 [in] void* pV |
|
74 The encoder. |
|
75 |
|
76 @description: Destructor. |
|
77 ** ----------------------------------------------------------------------- **/ |
|
78 void |
|
79 NW_XML_XmlpWbxmlEncoder_Delete(void* pV); |
|
80 |
|
81 |
|
82 /** ----------------------------------------------------------------------- ** |
|
83 @function: NW_XML_ComputeEncoding |
|
84 |
|
85 @synopsis: Compute encoding. |
|
86 |
|
87 @scope: public |
|
88 |
|
89 @parameters: |
|
90 [in] NW_Uint32 length |
|
91 Length of buffer. |
|
92 |
|
93 [in] const unsigned char* pBuf |
|
94 Buffer. |
|
95 |
|
96 [out] NW_Uint32* pEncoding |
|
97 The calculated encoding. |
|
98 |
|
99 [out] NW_XML_Endianness_t* pEndianness |
|
100 The calculated endianness. |
|
101 |
|
102 @description: Compute encoding. |
|
103 |
|
104 @returns: NW_Status_t |
|
105 Status of operation. |
|
106 |
|
107 [NW_STAT_SUCCESS] |
|
108 Endianness and encoding determined. |
|
109 |
|
110 [NW_STAT_FAILURE] |
|
111 Invalid length. Must be >= 4 to determine encoding. |
|
112 |
|
113 ** ----------------------------------------------------------------------- **/ |
|
114 IMPORT_C |
|
115 NW_Status_t |
|
116 NW_XML_ComputeEncoding(NW_Uint32 length, const unsigned char* pBuf, |
|
117 NW_Uint32* pEncoding, NW_XML_Endianness_t* pEndianness); |
|
118 |
|
119 |
|
120 /** ----------------------------------------------------------------------- ** |
|
121 @function: NW_XML_XmlToWbxml |
|
122 |
|
123 @synopsis: Convert buffer from Xml to Wbxml. |
|
124 |
|
125 @scope: public |
|
126 |
|
127 @parameters: |
|
128 [in] NW_Buffer_t* pInBuf |
|
129 The input buffer. |
|
130 |
|
131 [in] NW_Uint32 encoding |
|
132 The encoding. |
|
133 |
|
134 [out] NW_Buffer_t** ppOutBuf |
|
135 Converted data. |
|
136 |
|
137 [out] NW_Uint32* line |
|
138 Line count. |
|
139 |
|
140 [in] NW_Uint32 publicID |
|
141 The public ID. |
|
142 [out] void** WBXMLEncStrTbl: |
|
143 Stores the string table of WBXML encoder. |
|
144 |
|
145 @description: Convert buffer from Xml to Wbxml. |
|
146 |
|
147 @returns: NW_Status_t |
|
148 Status of operation. |
|
149 |
|
150 [NW_STAT_SUCCESS] |
|
151 Buffer converted to WBXML. |
|
152 |
|
153 [NW_STAT_FAILURE] |
|
154 Required parameter is NULL, doc has odd number of bytes |
|
155 or no data to process. |
|
156 |
|
157 ** ----------------------------------------------------------------------- **/ |
|
158 NW_Status_t |
|
159 NW_XML_XmlToWbxml(NW_Buffer_t* pInBuf, NW_Uint32 encoding, |
|
160 NW_Buffer_t** ppOutBuf, NW_Uint32* line, |
|
161 NW_Uint32 publicID, void** WBXMLEncStrTbl); |
|
162 |
|
163 |
|
164 #ifdef __cplusplus |
|
165 } // extern "C" { |
|
166 #endif /* __cplusplus */ |
|
167 |
|
168 #endif /* NW_XMLP2WBXML_H */ |
|