1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of global functions
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 Returns a negative value, 0, or positive value if @a p1 is less than, equal
11 to or greater than @e p2. The comparison is case-sensitive.
12 This function complements the standard C function @e stricmp() which performs
13 case-insensitive comparison.
15 int wxStrcmp(const char* p1
, const char* p2
);
19 @b NB: This function is obsolete, use wxString instead.
23 #define wxStringEq(s1, s2) (s1 && s2 && (strcmp(s1, s2) == 0))
26 bool wxStringEq(const wxString
& s1
, const wxString
& s2
);
29 @b NB: This function is obsolete, use wxString::Find instead.
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,
32 no substring matching is done.
34 bool wxStringMatch(const wxString
& s1
, const wxString
& s2
,
35 bool subString
= true,
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.
43 Returns the number of characters copied to the buffer or -1 if there is not
46 @see wxVsnprintf(), wxString::Printf
48 int wxSnprintf(wxChar
* buf
, size_t len
, const wxChar
* format
,
52 This is a convenience function wrapping
53 wxStringTokenizer which simply returns all tokens
54 found in the given @a str in an array.
56 wxStringTokenizer::wxStringTokenizer
57 for the description of the other parameters.
59 wxArrayString
wxStringTokenize(const wxString
& str
,
60 const wxString
& delims
= wxDEFAULT_DELIMITERS
,
61 wxStringTokenizerMode mode
= wxTOKEN_DEFAULT
);
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
66 @a p is the @NULL pointer.
68 size_t wxStrlen(const char* p
);
71 The same as wxSnprintf() but takes a @c va_list
72 argument instead of arbitrary number of parameters.
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,
77 wxVfprintf, wxVprintf, wxVsprintf) currently do not to support positional
79 even when @c wxUSE_PRINTF_POS_PARAMS is 1.
81 @see wxSnprintf(), wxString::PrintfV
83 int wxVsnprintf(wxChar
* buf
, size_t len
, const wxChar
* format
,
87 Returns @true if the pointer is either @NULL or points to an empty
88 string, @false otherwise.
90 bool wxIsEmpty(const char* p
);
93 Returns a negative value, 0, or positive value if @a p1 is less than, equal
94 to or greater than @e p2. The comparison is case-insensitive.
95 This function complements the standard C function @e strcmp() which performs
96 case-sensitive comparison.
98 int wxStricmp(const char* p1
, const char* p2
);