|
1 /* |
|
2 * Copyright (c) 2009 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: Contains all the API signatures |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __LIBUTILS_H__ |
|
21 #define __LIBUTILS_H__ |
|
22 |
|
23 #include <e32cmn.h> |
|
24 #include <string> |
|
25 |
|
26 using namespace std; |
|
27 |
|
28 enum TErrorCodes |
|
29 { |
|
30 ESuccess = 0, |
|
31 EInsufficientMemory = -1, |
|
32 EInvalidSize = -2, |
|
33 EStringNoData = -3, |
|
34 EInvalidPointer = -4, |
|
35 EDescriptorNoData = -5, |
|
36 EUseNewMaxL = -6, |
|
37 EInvalidMBSSequence = -7, |
|
38 EInvalidWCSSequence = -8, |
|
39 EInsufficientSystemMemory = -9 |
|
40 }; |
|
41 |
|
42 IMPORT_C int CharToTbuf16(const char* aSrc, TDes16& aDes); |
|
43 |
|
44 IMPORT_C int CharToTbuf8(const char* aSrc, TDes8& aDes); |
|
45 |
|
46 IMPORT_C int CharToHbufc16(const char* aSrc, HBufC16* aDes); |
|
47 |
|
48 IMPORT_C int CharToHbufc8(const char* aSrc, HBufC8* aDes); |
|
49 |
|
50 IMPORT_C int CharpToTptr8(const char* aSrc, TPtr8& aDes); |
|
51 |
|
52 IMPORT_C int CharpToTptr16(const char* aSrc, wchar_t* wPtr, TPtr16& aDes); |
|
53 |
|
54 IMPORT_C int CharpToTptrc16(char* aSrc, wchar_t* cPtr, TPtrC16& aDes); |
|
55 |
|
56 IMPORT_C int CharpToTptrc8(const char* aSrc, TPtrC8& aDes); |
|
57 |
|
58 IMPORT_C int CharToRbuf16(const char* aSrc, RBuf16& aDes); |
|
59 |
|
60 IMPORT_C int WcharToTbuf16(const wchar_t* aSrc, TDes16& aDes); |
|
61 |
|
62 IMPORT_C int WcharToTbuf8(const wchar_t* aSrc, TDes8& aDes); |
|
63 |
|
64 IMPORT_C int WcharToHbufc8(const wchar_t* aSrc, HBufC8* aDes); |
|
65 |
|
66 IMPORT_C int WcharToHbufc16(const wchar_t* aSrc, HBufC16* aDes); |
|
67 |
|
68 IMPORT_C int WcharpToTptr16(const wchar_t* aSrc, TPtr16& aDes); |
|
69 |
|
70 IMPORT_C int WcharpToTptr8 (const wchar_t* aSrc, char *cPtr, TPtr8& aDes); |
|
71 |
|
72 IMPORT_C int WcharpToTptrc8 (const wchar_t* aSrc, char* cPtr, TPtrC8& aDes); |
|
73 |
|
74 IMPORT_C int WcharpToTptrc16 (const wchar_t* aSrc, TPtrC16& aDes); |
|
75 |
|
76 IMPORT_C int WcharToRbuf8 (const wchar_t* aSrc, RBuf8& aDes); |
|
77 |
|
78 IMPORT_C int WcharToRbuf16 (const wchar_t* aSrc, RBuf16& aDes); |
|
79 |
|
80 IMPORT_C int StringToTbuf8 (string& aString, TDes8& aDes); |
|
81 |
|
82 IMPORT_C int StringToTbuf16 (string& aString, TDes16& aDes); |
|
83 |
|
84 IMPORT_C int StringToTptrc16 (string& aString, wchar_t *wptr, TPtrC16& aDes); |
|
85 |
|
86 IMPORT_C int StringToTptrc8 (string& aString, TPtrC8& aDes); |
|
87 |
|
88 IMPORT_C int StringToTptr8 (string& aString, TPtr8& aDes); |
|
89 |
|
90 IMPORT_C int StringToTptr16 (string& aSrc, wchar_t *wPtr, TPtr16& aDes); |
|
91 |
|
92 IMPORT_C int StringToHbufc16 (string& aString, HBufC16* aDes); |
|
93 |
|
94 IMPORT_C int StringToHbufc8 (string& aString, HBufC8* aDes); |
|
95 |
|
96 IMPORT_C int StringToRbuf8 (const string& aSrc, RBuf8& aDes); |
|
97 |
|
98 IMPORT_C int StringToRbuf16 (const string& aSrc, RBuf16& aDes); |
|
99 |
|
100 IMPORT_C int WstringToTbuf8 (wstring& aString, TDes8& aDes); |
|
101 |
|
102 IMPORT_C int WstringToTptr8 (wstring& aString, char* cPtr, TPtr8& aDes); |
|
103 |
|
104 IMPORT_C int WstringToTptr16 (wstring& aString, TPtr16& aDes); |
|
105 |
|
106 IMPORT_C int WstringToTptrc8 (wstring& aString, char* cPtr, TPtrC8& aDes); |
|
107 |
|
108 IMPORT_C int WstringToTptrc16 (wstring& aString , TPtrC16& aDes); |
|
109 |
|
110 IMPORT_C int WstringToRbuf8 (const wstring& aSrc, RBuf8& aDes); |
|
111 |
|
112 IMPORT_C int WstringToRbuf16 (const wstring& aSrc, RBuf16& aDes); |
|
113 |
|
114 IMPORT_C int Tbuf8ToString (TDes8& aSrc, string& aDes); |
|
115 |
|
116 IMPORT_C int Tptr8ToString (TDes8& aSrc, string& aDes); |
|
117 |
|
118 IMPORT_C int Tptrc8ToString (const TDesC8& aSrc, string& aDes); |
|
119 |
|
120 IMPORT_C int Tptr16ToString (TDes16& aDes, string& astring); |
|
121 |
|
122 IMPORT_C int Tptrc16ToString (const TDesC16& aDes, string& aString); |
|
123 |
|
124 IMPORT_C int Hbufc16ToString (HBufC16* aSrc, string& aString, int& n_size); |
|
125 |
|
126 IMPORT_C int Hbufc8ToString (HBufC8* aSrc, string& aString); |
|
127 |
|
128 IMPORT_C int Rbuf8ToString (TDes8& aSrc, string& aDes); |
|
129 |
|
130 IMPORT_C int Tbuf8ToChar (TDes8& aSrc, char* aDes, int& n_size); |
|
131 |
|
132 IMPORT_C int Tbuf16ToChar(TDes16& aSrc, char* aDes, int& n_size); |
|
133 |
|
134 IMPORT_C int Tbufc8ToChar (TDesC8& aSrc, char* aDes, int &n_size); |
|
135 |
|
136 IMPORT_C int Tbufc16ToChar (TDesC16& aSrc, char* aDes, int &n_size); |
|
137 |
|
138 IMPORT_C int Tlitc8ToChar (const TDesC8& aDes, char* aSrc, int& n_size); |
|
139 |
|
140 IMPORT_C int Tlitc16ToChar (const TDesC16& aDes, char* aSrc,int& n_size); |
|
141 |
|
142 IMPORT_C int Tptr8ToChar (const TDes8& aSrc, char* aDes, int& n_size); |
|
143 |
|
144 IMPORT_C int Tptr16ToCharp (const TDes16& aSrc, char* aDes, int& n_size); |
|
145 |
|
146 IMPORT_C int Tptrc8ToCharp (TPtrC8& aSrc, char* aDes, int& n_size); |
|
147 |
|
148 IMPORT_C int Tptrc16ToCharp (TPtrC16& aSrc, char* aDes, int& n_size); |
|
149 |
|
150 IMPORT_C int Rbuf8ToChar (TDes8& aSrc, char * aDes, int& n_size); |
|
151 |
|
152 IMPORT_C int Rbuf16ToChar (TDes16& aSrc, char* aDes, int& n_size); |
|
153 |
|
154 IMPORT_C int Tbuf8ToWchar (TDes8& aSrc , wchar_t* aDes, int& n_size); |
|
155 |
|
156 IMPORT_C int Tbuf16ToWchar (const TDes16& aSrc, wchar_t* aDes, int &n_size); |
|
157 |
|
158 IMPORT_C int Tbufc8ToWchar (TDesC8& aSrc, wchar_t* aDes, int& n_size); |
|
159 |
|
160 IMPORT_C int Tbufc16ToWchar (TDesC& aSrc, wchar_t* aDes, int& n_size); |
|
161 |
|
162 IMPORT_C int Tlitc8ToWchar (const TDesC8& aDes, wchar_t* aSrc, int& n_size); |
|
163 |
|
164 IMPORT_C int Tlitc16ToWchar (const TDesC16& aSrc, wchar_t* aDes, int& n_size); |
|
165 |
|
166 IMPORT_C int Tptr8ToWcharp (const TPtr8& aSrc, wchar_t* aDes, int& n_size); |
|
167 |
|
168 IMPORT_C int Tptr16ToWcharp (const TPtr16& aSrc, wchar_t* aDes, int& n_size); |
|
169 |
|
170 IMPORT_C int Tptrc8ToWcharp (TPtrC8& aSrc, wchar_t* aDes, int& n_size); |
|
171 |
|
172 IMPORT_C int Tptrc16ToWcharp (TPtrC16& aSrc, wchar_t* aDes, int& n_size); |
|
173 |
|
174 IMPORT_C int Rbuf8ToWchar (TDes8& aSrc, wchar_t* aDes, int& n_size); |
|
175 |
|
176 IMPORT_C int Rbuf16ToWchar (TDes16& aSrc, wchar_t* aDes, int& n_size); |
|
177 |
|
178 IMPORT_C int WcharpToTptrc8(const wchar_t* aSrc, TDes16& aDes); |
|
179 |
|
180 IMPORT_C int WcharpToTptr16(const wchar_t* aSrc, TDes16& aDes); |
|
181 |
|
182 IMPORT_C int Tptrc8ToWstring (TPtrC8& aSrc, wstring& aDes); |
|
183 |
|
184 IMPORT_C int Tptrc16ToWstring (TPtrC16& aSrc, wstring& aDes); |
|
185 |
|
186 IMPORT_C int Tptr8ToWstring (TPtr8& aSrc, wstring& aDes); |
|
187 |
|
188 IMPORT_C int Tptr16ToWstring (TPtr16& aSrc, wstring& aDes); |
|
189 |
|
190 IMPORT_C int Rbuf8ToWstring (TDes8& aSrc, wstring& aDes); |
|
191 |
|
192 IMPORT_C int Rbuf16ToWstring (TDes16& aSrc, wstring& aDes); |
|
193 |
|
194 IMPORT_C int Rbuf16ToString(TDes16& aSrc, string& aDes); |
|
195 |
|
196 IMPORT_C int Tbufc8ToString(TDesC8& aSrc, string& aDes); |
|
197 |
|
198 IMPORT_C int Tbufc16ToString(TDesC16& aSrc, string& aDes); |
|
199 |
|
200 IMPORT_C int Tlit8ToString(const TDesC8& aSrc, string& aDes); |
|
201 |
|
202 IMPORT_C int Tlit16ToString(const TDesC16& aSrc, string& aDes); |
|
203 |
|
204 IMPORT_C int Hbufc16ToWstring(HBufC16* aSrc, wstring& aDes); |
|
205 |
|
206 IMPORT_C int Tlitc16ToWstring(TDesC16* aSrc, wstring& aDes); |
|
207 |
|
208 IMPORT_C int Tlitc8ToWstring(TDes8& aSrc, wstring& aDes); |
|
209 |
|
210 IMPORT_C int Hbufc8ToWstring(HBufC8* aSrc, wstring& aDes); |
|
211 |
|
212 IMPORT_C int WstringToHbufc8(wstring& aSrc, HBufC8* aDes); |
|
213 |
|
214 IMPORT_C int WstringToTbuf16(wstring& aSrc, TDes16& aDes); |
|
215 |
|
216 IMPORT_C int WstringToHbufc16(wstring& aSrc, HBufC16* aDes); |
|
217 |
|
218 IMPORT_C int CharToRbuf8(const char* aSrc, RBuf8& aDes); |
|
219 |
|
220 IMPORT_C int Tbuf8ToWstring(TDes8& aSrc, wstring& aDes); |
|
221 |
|
222 IMPORT_C int Tbufc8ToWstring(TDesC8& aSrc, wstring& aDes); |
|
223 |
|
224 IMPORT_C int HBufc8ToWchar(HBufC8* aSrc, wchar_t* aDes, int& n_size); |
|
225 |
|
226 IMPORT_C int Tbuf16ToWstring(TDes16& aSrc, wstring& aDes); |
|
227 |
|
228 IMPORT_C int Hbufc16ToWchar(const HBufC16* aSrc, wchar_t* aDes, int& n_size); |
|
229 |
|
230 IMPORT_C int Hbufc8ToChar(HBufC8 *aSrc, char* aDes, int& n_size); |
|
231 |
|
232 IMPORT_C int Tbuf16ToString(TDes16& aSrc, string& aDes); |
|
233 |
|
234 #endif // __LIBUTILS_H__ |
|
235 |
|
236 |