]> git.saurik.com Git - wxWidgets.git/blob - interface/wxcrt.h
revised base64.h;bitmap.h
[wxWidgets.git] / interface / wxcrt.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wxcrt.h
3 // Purpose: interface of global functions
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
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.
14 */
15 int wxStrcmp(const char* p1, const char* p2);
16
17
18 /**
19 @b NB: This function is obsolete, use wxString instead.
20 A macro defined as:
21
22 @code
23 #define wxStringEq(s1, s2) (s1 && s2 && (strcmp(s1, s2) == 0))
24 @endcode
25 */
26 bool wxStringEq(const wxString& s1, const wxString& s2);
27
28 /**
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.
33 */
34 bool wxStringMatch(const wxString& s1, const wxString& s2,
35 bool subString = true,
36 bool exact = false);
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.
43 Returns the number of characters copied to the buffer or -1 if there is not
44 enough space.
45
46 @see wxVsnprintf(), wxString::Printf
47 */
48 int wxSnprintf(wxChar* buf, size_t len, const wxChar* format,
49 ...);
50
51 /**
52 This is a convenience function wrapping
53 wxStringTokenizer which simply returns all tokens
54 found in the given @a str in an array.
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
66 @a p is the @NULL pointer.
67 */
68 size_t wxStrlen(const char* p);
69
70 /**
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,
76 wxVfprintf,
77 wxVfprintf, wxVprintf, wxVsprintf) currently do not to support positional
78 parameters
79 even when @c wxUSE_PRINTF_POS_PARAMS is 1.
80
81 @see wxSnprintf(), wxString::PrintfV
82 */
83 int wxVsnprintf(wxChar* buf, size_t len, const wxChar* format,
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 */
90 bool wxIsEmpty(const char* p);
91
92 /**
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.
97 */
98 int wxStricmp(const char* p1, const char* p2);
99