]>
Commit | Line | Data |
---|---|---|
23324ae1 | 1 | ///////////////////////////////////////////////////////////////////////////// |
7c913512 | 2 | // Name: wxcrt.h |
e54c96f1 | 3 | // Purpose: interface of global functions |
7c913512 FM |
4 | // Author: wxWidgets team |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
4cc4bfaf | 10 | Returns a negative value, 0, or positive value if @a p1 is less than, equal |
7c913512 | 11 | to or greater than @e p2. The comparison is case-sensitive. |
7c913512 FM |
12 | This function complements the standard C function @e stricmp() which performs |
13 | case-insensitive comparison. | |
23324ae1 | 14 | */ |
4cc4bfaf | 15 | int wxStrcmp(const char* p1, const char* p2); |
23324ae1 FM |
16 | |
17 | ||
7c913512 FM |
18 | /** |
19 | @b NB: This function is obsolete, use wxString instead. | |
7c913512 | 20 | A macro defined as: |
4cc4bfaf | 21 | |
7c913512 FM |
22 | @code |
23 | #define wxStringEq(s1, s2) (s1 && s2 && (strcmp(s1, s2) == 0)) | |
24 | @endcode | |
23324ae1 FM |
25 | */ |
26 | bool wxStringEq(const wxString& s1, const wxString& s2); | |
27 | ||
28 | /** | |
29 | @b NB: This function is obsolete, use wxString::Find instead. | |
4cc4bfaf FM |
30 | Returns @true if the substring @a s1 is found within @e s2, |
31 | ignoring case if @a exact is @false. If @a subString is @false, | |
23324ae1 FM |
32 | no substring matching is done. |
33 | */ | |
34 | bool wxStringMatch(const wxString& s1, const wxString& s2, | |
4cc4bfaf FM |
35 | bool subString = true, |
36 | bool exact = false); | |
23324ae1 FM |
37 | |
38 | /** | |
39 | This function replaces the dangerous standard function @c sprintf() and is | |
40 | like @c snprintf() available on some platforms. The only difference with | |
41 | sprintf() is that an additional argument - buffer size - is taken and the | |
42 | buffer is never overflowed. | |
23324ae1 FM |
43 | Returns the number of characters copied to the buffer or -1 if there is not |
44 | enough space. | |
7c913512 | 45 | |
e54c96f1 | 46 | @see wxVsnprintf(), wxString::Printf |
23324ae1 | 47 | */ |
4cc4bfaf | 48 | int wxSnprintf(wxChar* buf, size_t len, const wxChar* format, |
7c913512 | 49 | ...); |
23324ae1 FM |
50 | |
51 | /** | |
52 | This is a convenience function wrapping | |
53 | wxStringTokenizer which simply returns all tokens | |
4cc4bfaf | 54 | found in the given @a str in an array. |
23324ae1 FM |
55 | Please see |
56 | wxStringTokenizer::wxStringTokenizer | |
57 | for the description of the other parameters. | |
58 | */ | |
59 | wxArrayString wxStringTokenize(const wxString& str, | |
60 | const wxString& delims = wxDEFAULT_DELIMITERS, | |
61 | wxStringTokenizerMode mode = wxTOKEN_DEFAULT); | |
62 | ||
63 | /** | |
64 | This is a safe version of standard function @e strlen(): it does exactly the | |
65 | same thing (i.e. returns the length of the string) except that it returns 0 if | |
4cc4bfaf | 66 | @a p is the @NULL pointer. |
23324ae1 | 67 | */ |
4cc4bfaf | 68 | size_t wxStrlen(const char* p); |
23324ae1 FM |
69 | |
70 | /** | |
e54c96f1 | 71 | The same as wxSnprintf() but takes a @c va_list |
23324ae1 | 72 | argument instead of arbitrary number of parameters. |
23324ae1 FM |
73 | Note that if @c wxUSE_PRINTF_POS_PARAMS is set to 1, then this function supports |
74 | positional arguments (see wxString::Printf for more information). | |
75 | However other functions of the same family (wxPrintf, wxSprintf, wxFprintf, | |
76 | wxVfprintf, | |
77 | wxVfprintf, wxVprintf, wxVsprintf) currently do not to support positional | |
78 | parameters | |
79 | even when @c wxUSE_PRINTF_POS_PARAMS is 1. | |
7c913512 | 80 | |
e54c96f1 | 81 | @see wxSnprintf(), wxString::PrintfV |
23324ae1 | 82 | */ |
4cc4bfaf | 83 | int wxVsnprintf(wxChar* buf, size_t len, const wxChar* format, |
23324ae1 FM |
84 | va_list argPtr); |
85 | ||
86 | /** | |
87 | Returns @true if the pointer is either @NULL or points to an empty | |
88 | string, @false otherwise. | |
89 | */ | |
4cc4bfaf | 90 | bool wxIsEmpty(const char* p); |
23324ae1 FM |
91 | |
92 | /** | |
4cc4bfaf | 93 | Returns a negative value, 0, or positive value if @a p1 is less than, equal |
23324ae1 | 94 | to or greater than @e p2. The comparison is case-insensitive. |
23324ae1 FM |
95 | This function complements the standard C function @e strcmp() which performs |
96 | case-sensitive comparison. | |
97 | */ | |
4cc4bfaf | 98 | int wxStricmp(const char* p1, const char* p2); |
23324ae1 | 99 |