1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for global functions
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 Returns a negative value, 0, or positive value if @e p1 is less than, equal
11 to or greater than @e p2. The comparison is case-sensitive.
13 This function complements the standard C function @e stricmp() which performs
14 case-insensitive comparison.
16 int wxStrcmp(const char * p1
, const char * p2
);
20 @b NB: This function is obsolete, use wxString instead.
24 #define wxStringEq(s1, s2) (s1 && s2 && (strcmp(s1, s2) == 0))
27 bool wxStringEq(const wxString
& s1
, const wxString
& s2
);
30 @b NB: This function is obsolete, use wxString::Find instead.
32 Returns @true if the substring @e s1 is found within @e s2,
33 ignoring case if @e exact is @false. If @e subString is @false,
34 no substring matching is done.
36 bool wxStringMatch(const wxString
& s1
, const wxString
& s2
,
37 bool subString
= @
true,
41 This function replaces the dangerous standard function @c sprintf() and is
42 like @c snprintf() available on some platforms. The only difference with
43 sprintf() is that an additional argument - buffer size - is taken and the
44 buffer is never overflowed.
46 Returns the number of characters copied to the buffer or -1 if there is not
49 @sa wxVsnprintf, wxString::Printf
51 int wxSnprintf(wxChar
* buf
, size_t len
, const wxChar
* format
,
55 This is a convenience function wrapping
56 wxStringTokenizer which simply returns all tokens
57 found in the given @e str in an array.
60 wxStringTokenizer::wxStringTokenizer
61 for the description of the other parameters.
63 wxArrayString
wxStringTokenize(const wxString
& str
,
64 const wxString
& delims
= wxDEFAULT_DELIMITERS
,
65 wxStringTokenizerMode mode
= wxTOKEN_DEFAULT
);
68 This is a safe version of standard function @e strlen(): it does exactly the
69 same thing (i.e. returns the length of the string) except that it returns 0 if
70 @e p is the @NULL pointer.
72 size_t wxStrlen(const char * p
);
75 The same as wxSnprintf but takes a @c va_list
76 argument instead of arbitrary number of parameters.
78 Note that if @c wxUSE_PRINTF_POS_PARAMS is set to 1, then this function supports
79 positional arguments (see wxString::Printf for more information).
80 However other functions of the same family (wxPrintf, wxSprintf, wxFprintf,
82 wxVfprintf, wxVprintf, wxVsprintf) currently do not to support positional
84 even when @c wxUSE_PRINTF_POS_PARAMS is 1.
86 @sa wxSnprintf, wxString::PrintfV
88 int wxVsnprintf(wxChar
* buf
, size_t len
, const wxChar
* format
,
92 Returns @true if the pointer is either @NULL or points to an empty
93 string, @false otherwise.
95 bool wxIsEmpty(const char * p
);
98 Returns a negative value, 0, or positive value if @e p1 is less than, equal
99 to or greater than @e p2. The comparison is case-insensitive.
101 This function complements the standard C function @e strcmp() which performs
102 case-sensitive comparison.
104 int wxStricmp(const char * p1
, const char * p2
);