wxGetEmptyString() function added

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@243 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1998-07-12 22:40:00 +00:00
parent 02ce7b722e
commit f04f399187

View File

@@ -80,8 +80,19 @@ inline size_t WXDLLEXPORT Strlen(const char *psz)
/// portable strcasecmp/_stricmp /// portable strcasecmp/_stricmp
int WXDLLEXPORT Stricmp(const char *, const char *); int WXDLLEXPORT Stricmp(const char *, const char *);
// ----------------------------------------------------------------------------
// global data
// ----------------------------------------------------------------------------
// global pointer to empty string
extern const char *g_szNul;
// return an empty wxString
class wxString; // not yet defined
inline const wxString& wxGetEmptyString() { return *(wxString *)&g_szNul; }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// string data prepended with some housekeeping info (used by String class), // string data prepended with some housekeeping info (used by wxString class),
// is never used directly (but had to be put here to allow inlining) // is never used directly (but had to be put here to allow inlining)
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
struct WXDLLEXPORT wxStringData struct WXDLLEXPORT wxStringData
@@ -107,8 +118,6 @@ struct WXDLLEXPORT wxStringData
bool IsValid() const { return nRefs != 0; } bool IsValid() const { return nRefs != 0; }
}; };
extern const char *g_szNul; // global pointer to empty string
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
/** /**
This is (yet another one) String class for C++ programmers. It doesn't use This is (yet another one) String class for C++ programmers. It doesn't use