equal
deleted
inserted
replaced
55 * |
55 * |
56 * @param aSrc is the Wstring to be converted , aDes is the |
56 * @param aSrc is the Wstring to be converted , aDes is the |
57 * reference to the descriptor where the result of conversion |
57 * reference to the descriptor where the result of conversion |
58 * is stored |
58 * is stored |
59 * @return Status code (0 is ESuccess, -1 is EInsufficientMemory, |
59 * @return Status code (0 is ESuccess, -1 is EInsufficientMemory, |
60 * -3 is EStringNoData, -6 is EUseNewMaxL ) |
60 * -3 is EStringNoData ) |
61 */ |
61 */ |
62 |
62 |
63 EXPORT_C int WcharToHbufc16 (const wchar_t* aSrc ,HBufC16* aDes ) |
63 EXPORT_C int WcharToHbufc16 (const wchar_t* aSrc ,HBufC16* aDes ) |
64 { |
64 { |
65 |
65 |
141 * Converts a wchar to a descriptor of type RBuf16 |
141 * Converts a wchar to a descriptor of type RBuf16 |
142 * |
142 * |
143 * @param aSrc is the wchar to be converted , aDes is the |
143 * @param aSrc is the wchar to be converted , aDes is the |
144 * reference to the descriptor where the result of conversion |
144 * reference to the descriptor where the result of conversion |
145 * is stored |
145 * is stored |
146 * @return Status code (0 is ESuccess ,-1 is EInsufficientMemory, |
146 * @return Status code (0 is ESuccess ,-1 is EInsufficientMemory -3 is EStringNoData ) |
147 * -3 is EStringNoData, -4 is EInvalidPointer ) |
|
148 */ |
147 */ |
149 |
148 |
150 EXPORT_C int WcharToRbuf16(const wchar_t* aSrc, RBuf16& aDes) |
149 EXPORT_C int WcharToRbuf16(const wchar_t* aSrc, RBuf16& aDes) |
151 { |
150 { |
152 |
151 |
156 { |
155 { |
157 return EInvalidPointer; |
156 return EInvalidPointer; |
158 } |
157 } |
159 |
158 |
160 wlen = wcslen(aSrc); |
159 wlen = wcslen(aSrc); |
161 |
160 |
162 aDes.Copy((const unsigned short *)aSrc, wlen); |
161 if (KErrNone == aDes.Create(wlen)) |
163 |
162 { |
|
163 aDes.Copy((const unsigned short *)aSrc, wlen); |
|
164 } |
|
165 else |
|
166 { |
|
167 retval = EInsufficientSystemMemory; |
|
168 } |
|
169 |
164 return retval; |
170 return retval; |
165 } |
171 } |