|
1 /* |
|
2 * Copyright (c) 1999 - 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 $Workfile: scr_str.h $ |
|
21 |
|
22 Purpose: |
|
23 */ |
|
24 |
|
25 #ifndef SCR_STR_H |
|
26 #define SCR_STR_H |
|
27 |
|
28 #include "scr_defs.h" |
|
29 |
|
30 |
|
31 typedef NW_Ucs2* str_t; |
|
32 |
|
33 /* Create a new length-counted ucs2 string */ |
|
34 str_t new_str(NW_Int32 length, NW_Ucs2 *buf); |
|
35 |
|
36 /* Free a length-counted ucs2 string */ |
|
37 void free_str(str_t str); |
|
38 |
|
39 /* Return length of length-counted ucs2 string */ |
|
40 NW_Int32 str_len(str_t str); |
|
41 |
|
42 /* Return pointer to storage for length-counted ucs2 string */ |
|
43 NW_Ucs2* str_buf_ptr(str_t str); |
|
44 |
|
45 /* Concatinate 2 length-counted ucs2 strings */ |
|
46 str_t str_cat(str_t str1, str_t str2); |
|
47 |
|
48 /* Concatinate 3 length-counted ucs2 strings */ |
|
49 str_t str_cat3(str_t str1, str_t str2, str_t str3); |
|
50 |
|
51 /* Duplicate a length-counted ucs2 string */ |
|
52 str_t dup_str(str_t str); |
|
53 |
|
54 /* Compare 2 length-counted ucs2 strings */ |
|
55 NW_Int32 str_cmp(str_t str1, str_t str2); |
|
56 |
|
57 /* Return the character at the given index */ |
|
58 NW_Ucs2 scr_charat(str_t str, NW_Int32 index); |
|
59 |
|
60 /* Extract a substring from a length-counted ucs2 string */ |
|
61 str_t scr_substr(str_t str, NW_Int32 start, NW_Int32 len); |
|
62 |
|
63 /* Find position of 2nd string in 1st string */ |
|
64 NW_Int32 str_find(str_t str1, str_t str2, NW_Int32 start); |
|
65 |
|
66 NW_Int32 str_times(str_t s, NW_Ucs2 separator); |
|
67 str_t str_replace(str_t s, str_t old_str, str_t newstr); |
|
68 str_t str_elementat(str_t s, NW_Int32 index, NW_Ucs2 separator); |
|
69 str_t str_removeat(str_t s, NW_Int32 index, NW_Ucs2 separator); |
|
70 str_t str_replaceat(str_t s, str_t newstr, NW_Int32 index, NW_Ucs2 separator); |
|
71 str_t str_insertat(str_t s, str_t newstr, NW_Int32 index, NW_Ucs2 separator); |
|
72 str_t str_squeeze(str_t s); |
|
73 str_t str_trim(str_t s); |
|
74 |
|
75 NW_Bool str_is_empty(str_t s); |
|
76 NW_Bool str_is_alpha(NW_Ucs2 c); |
|
77 NW_Bool str_is_digit(NW_Ucs2 c); |
|
78 NW_Bool str_is_reserved(str_t s); |
|
79 |
|
80 #endif |
|
81 |