wxString wxDateTime::GetMonthName(wxDateTime::Month month,
wxDateTime::NameFlags flags)
{
- wxCHECK_MSG( month != Inv_Month, _T(""), _T("invalid month") );
+ wxCHECK_MSG( month != Inv_Month, wxEmptyString, _T("invalid month") );
// notice that we must set all the fields to avoid confusing libc (GNU one
// gets confused to a crash if we don't do this)
wxString wxDateTime::GetWeekDayName(wxDateTime::WeekDay wday,
wxDateTime::NameFlags flags)
{
- wxCHECK_MSG( wday != Inv_WeekDay, _T(""), _T("invalid weekday") );
+ wxCHECK_MSG( wday != Inv_WeekDay, wxEmptyString, _T("invalid weekday") );
// take some arbitrary Sunday (but notice that the day should be such that
// after adding wday to it below we still have a valid date, e.g. don't
wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const
{
- wxCHECK_MSG( format, _T(""), _T("NULL format in wxDateTime::Format") );
+ wxCHECK_MSG( format, wxEmptyString, _T("NULL format in wxDateTime::Format") );
// we have to use our own implementation if the date is out of range of
// strftime() or if we use non standard specificators
// %l milliseconds (000 - 999)
wxString wxTimeSpan::Format(const wxChar *format) const
{
- wxCHECK_MSG( format, _T(""), _T("NULL format in wxTimeSpan::Format") );
+ wxCHECK_MSG( format, wxEmptyString, _T("NULL format in wxTimeSpan::Format") );
wxString str;
str.Alloc(wxStrlen(format));
wxString wxStringHashTable::Get(long key, bool *wasFound) const
{
- wxCHECK_MSG( m_hashSize, _T(""), _T("must call Create() first") );
+ wxCHECK_MSG( m_hashSize, wxEmptyString, _T("must call Create() first") );
size_t slot = (size_t)abs((int)(key % (long)m_hashSize));
if ( wasFound )
*wasFound = false;
- return _T("");
+ return wxEmptyString;
}
bool wxStringHashTable::Delete(long key) const
{
#if wxUSE_WCHAR_T
wxCSConv *csConv = NULL;
- if ( !m_charset.IsEmpty() )
+ if ( !m_charset.empty() )
csConv = new wxCSConv(m_charset);
wxMBConv& inputConv = csConv ? *((wxMBConv*)csConv) : *wxConvCurrent;
// the short name will be used to look for catalog files as well,
// so we need something here
- if ( m_strShort.IsEmpty() ) {
+ if ( m_strShort.empty() ) {
// FIXME I don't know how these 2 letter abbreviations are formed,
// this wild guess is surely wrong
if ( szLocale && szLocale[0] )
if (codepage != 0)
locale << wxT(".") << buffer;
}
- if (locale.IsEmpty())
+ if (locale.empty())
{
wxLogLastError(wxT("SetThreadLocale"));
wxLogError(wxT("Cannot set locale to language %s."), name.c_str());
if ( pMsgCat == NULL )
return wxEmptyString;
- pszTrans = pMsgCat->GetString(wxT(""), (size_t)-1);
+ pszTrans = pMsgCat->GetString(wxEmptyString, (size_t)-1);
}
else
{
// search in all domains
for ( pMsgCat = m_pMsgCat; pMsgCat != NULL; pMsgCat = pMsgCat->m_pNext )
{
- pszTrans = pMsgCat->GetString(wxT(""), (size_t)-1);
+ pszTrans = pMsgCat->GetString(wxEmptyString, (size_t)-1);
if ( pszTrans != NULL ) // take the first found
break;
}
}
}
- if ( current.IsEmpty() ) {
+ if ( current.empty() ) {
wxLogDebug(wxT("No accel key found, accel string ignored."));
}
else {
{
wxMenuItem *item = FindItem(id);
- wxCHECK_MSG( item, wxT(""), wxT("wxMenu::GetLabel: no such item") );
+ wxCHECK_MSG( item, wxEmptyString, wxT("wxMenu::GetLabel: no such item") );
return item->GetText();
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_MSG( item, wxT(""), wxT("wxMenu::GetHelpString: no such item") );
+ wxCHECK_MSG( item, wxEmptyString, wxT("wxMenu::GetHelpString: no such item") );
return item->GetHelp();
}
// know of the correct solution, try to guess what we have to do.
// test now carried out on reading file so test should never get here
- if ( !hasFilename && !str.IsEmpty()
+ if ( !hasFilename && !str.empty()
#ifdef __UNIX__
&& !str.StartsWith(_T("test "))
#endif // Unix
// VZ: should we do this?
// chris elliott : only makes sense in MS windows
if ( sTmp.empty() )
- GetOpenCommand(&sTmp, wxFileType::MessageParameters(wxT(""), wxT("")));
+ GetOpenCommand(&sTmp, wxFileType::MessageParameters(wxEmptyString, wxEmptyString));
#endif
wxCHECK_MSG( !sTmp.empty(), false, _T("need the icon file") );
{ return &data.wxTEMPLATED_MEMBER_CALL(Get , wxObject) ; }
wxxVariant wxObjectToVariantConverterwxObject ( wxObject *data )
{ return wxxVariant( dynamic_cast<wxObject*> (data) ) ; }
- wxClassInfo wxObject::ms_classInfo(ms_classParents , wxT("") , wxT("wxObject"),
+ wxClassInfo wxObject::ms_classInfo(ms_classParents , wxEmptyString , wxT("wxObject"),
(int) sizeof(wxObject), \
(wxObjectConstructorFn) 0 ,
(wxPropertyInfo*) NULL,(wxHandlerInfo*) NULL,0 , 0 ,
{
m_paperId = wxPAPER_NONE;
m_platformId = 0;
- m_paperName = wxT("");
+ m_paperName = wxEmptyString;
m_width = 0;
m_height = 0;
}
bool wxIPV4address::Hostname(const wxString& name)
{
// Some people are sometimes fool.
- if (name == wxT(""))
+ if (name.empty())
{
wxLogWarning( _("Trying to solve a NULL hostname: giving up") );
return false;
bool wxIPV6address::Hostname(const wxString& name)
{
- if (name == wxT(""))
+ if (name.empty())
{
wxLogWarning( _("Trying to solve a NULL hostname: giving up") );
return false;
// get the address object for the given server name, the caller must delete it
static wxSockAddress *
-GetAddressFromName(const wxString& serverName, const wxString& host = _T(""))
+GetAddressFromName(const wxString& serverName, const wxString& host = wxEmptyString)
{
// we always use INET sockets under non-Unix systems
#if defined(__UNIX__) && !defined(__WXMAC__) && !defined(__WINE__)
wxString wxToolBarBase::GetToolShortHelp(int id) const
{
wxToolBarToolBase *tool = FindById(id);
- wxCHECK_MSG( tool, _T(""), _T("no such tool") );
+ wxCHECK_MSG( tool, wxEmptyString, _T("no such tool") );
return tool->GetShortHelp();
}
wxString wxToolBarBase::GetToolLongHelp(int id) const
{
wxToolBarToolBase *tool = FindById(id);
- wxCHECK_MSG( tool, _T(""), _T("no such tool") );
+ wxCHECK_MSG( tool, wxEmptyString, _T("no such tool") );
return tool->GetLongHelp();
}
wxFAIL_MSG(wxT("bad buffer type in wxTextBuffer::GetEOL."));
// fall through nevertheless - we must return something...
- case wxTextFileType_None: return wxT("");
+ case wxTextFileType_None: return wxEmptyString;
case wxTextFileType_Unix: return wxT("\n");
case wxTextFileType_Dos: return wxT("\r\n");
case wxTextFileType_Mac: return wxT("\r");
void wxURI::Clear()
{
m_scheme = m_user = m_server = m_port = m_path =
- m_query = m_fragment = wxT("");
+ m_query = m_fragment = wxEmptyString;
m_hostType = wxURI_REGNAME;
}
else
//relative uri with relative path reference
- m_scheme = wxT("");
+ m_scheme = wxEmptyString;
}
// else
//relative uri with _possible_ relative path reference
uricopy = ++uri;
}
else
- m_user = wxT("");
+ m_user = wxEmptyString;
return uricopy;
}
wxChar *
copystring (const wxChar *s)
{
- if (s == NULL) s = wxT("");
+ if (s == NULL) s = wxEmptyString;
size_t len = wxStrlen (s) + 1;
wxChar *news = new wxChar[len];
#ifdef wxINSTALL_PREFIX
return wxT(wxINSTALL_PREFIX);
#else
- return wxT("");
+ return wxEmptyString;
#endif
}
bool wxVariantDataList::Write(wxString& str) const
{
- str = wxT("");
+ str = wxEmptyString;
wxList::compatibility_iterator node = m_value.GetFirst();
while (node)
{
if (GetData()->Write(str))
return str;
}
- return wxString(wxT(""));
+ return wxEmptyString;
}
// Accessors
wxWindow *
wxWindowBase::FindWindowById( long id, const wxWindow* parent )
{
- return wxFindWindowHelper(parent, _T(""), id, wxFindWindowCmpIds);
+ return wxFindWindowHelper(parent, wxEmptyString, id, wxFindWindowCmpIds);
}
// ----------------------------------------------------------------------------
#ifdef __WXDEBUG__
_T(" Debug build"),
#else
- _T(""),
+ wxEmptyString,
#endif
__TDATE__,
__TTIME__
}
else
{
- val = wxT("");
+ val = wxEmptyString;
len = 0;
}
// convert the strings into MB representation and run ANSI version
// of the function. This doesn't work with %c and %s because of difference
// in size of char and wchar_t, though.
-
+
wxCHECK_MSG( wxStrstr(format, _T("%s")) == NULL, -1,
_T("incomplete vswscanf implementation doesn't allow %s") );
wxCHECK_MSG( wxStrstr(format, _T("%c")) == NULL, -1,
_T("incomplete vswscanf implementation doesn't allow %c") );
-
+
va_list argcopy;
wxVaCopy(argcopy, argptr);
return vsscanf(wxConvLibc.cWX2MB(ws), wxConvLibc.cWX2MB(format), argcopy);
WXDLLEXPORT int wxToupper(wxChar ch) { return (wxChar)CharUpper((LPTSTR)(ch)); }
#endif
-#if defined(__DARWIN__) && ( MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_2 )
+#if defined(__DARWIN__) && ( MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_2 )
WXDLLEXPORT size_t wxInternalMbstowcs (wchar_t * out, const char * in, size_t outlen)
{
outsize++;
return outsize;
}
-
+
const char* origin = in;
-
+
while (outlen-- && *in)
{
*out++ = (wchar_t) *in++;
}
-
+
*out = '\0';
-
+
return in - origin;
}
outsize++;
return outsize;
}
-
+
const wchar_t* origin = in;
-
+
while (outlen-- && *in)
{
*out++ = (char) *in++;
}
-
+
*out = '\0';
-
+
return in - origin;
}
-
+
#if defined(wxNEED_WX_CTYPE_H)
#include <CoreFoundation/CoreFoundation.h>
size_t n = 0;
while ( *s++ )
n++;
-
+
return n;
}
if (value == m_members[i].m_value)
return m_members[i].m_name;
- return wxT("") ;
+ return wxEmptyString ;
}
int wxEnumData::GetEnumMemberValueByIndex( int idx ) const
if ( ms_typeTable == NULL )
ms_typeTable = new wxTypeInfoMap() ;
- if( !m_name.IsEmpty() )
+ if( !m_name.empty() )
(*ms_typeTable)[m_name] = this ;
}
void wxTypeInfo::Unregister()
{
- if( !m_name.IsEmpty() )
+ if( !m_name.empty() )
ms_typeTable->erase(m_name);
}