.empty() string cleaning.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31695 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-02-01 19:37:36 +00:00
parent bcf576ccfe
commit b494c48b31
14 changed files with 84 additions and 86 deletions

View File

@@ -345,7 +345,7 @@ void wxAppConsole::OnInitCmdLine(wxCmdLineParser& parser)
#if wxUSE_LOG #if wxUSE_LOG
{ {
wxCMD_LINE_SWITCH, wxCMD_LINE_SWITCH,
_T(""), wxEmptyString,
OPTION_VERBOSE, OPTION_VERBOSE,
gettext_noop("generate verbose log messages"), gettext_noop("generate verbose log messages"),
wxCMD_LINE_VAL_NONE, wxCMD_LINE_VAL_NONE,
@@ -356,9 +356,9 @@ void wxAppConsole::OnInitCmdLine(wxCmdLineParser& parser)
// terminator // terminator
{ {
wxCMD_LINE_NONE, wxCMD_LINE_NONE,
_T(""), wxEmptyString,
_T(""), wxEmptyString,
_T(""), wxEmptyString,
wxCMD_LINE_VAL_NONE, wxCMD_LINE_VAL_NONE,
0x0 0x0
} }

View File

@@ -184,7 +184,7 @@ void wxAppBase::OnInitCmdLine(wxCmdLineParser& parser)
#ifdef __WXUNIVERSAL__ #ifdef __WXUNIVERSAL__
{ {
wxCMD_LINE_OPTION, wxCMD_LINE_OPTION,
_T(""), wxEmptyString,
OPTION_THEME, OPTION_THEME,
gettext_noop("specify the theme to use"), gettext_noop("specify the theme to use"),
wxCMD_LINE_VAL_STRING, wxCMD_LINE_VAL_STRING,
@@ -198,7 +198,7 @@ void wxAppBase::OnInitCmdLine(wxCmdLineParser& parser)
// and not mgl/app.cpp // and not mgl/app.cpp
{ {
wxCMD_LINE_OPTION, wxCMD_LINE_OPTION,
_T(""), wxEmptyString,
OPTION_MODE, OPTION_MODE,
gettext_noop("specify display mode to use (e.g. 640x480-16)"), gettext_noop("specify display mode to use (e.g. 640x480-16)"),
wxCMD_LINE_VAL_STRING, wxCMD_LINE_VAL_STRING,
@@ -209,9 +209,9 @@ void wxAppBase::OnInitCmdLine(wxCmdLineParser& parser)
// terminator // terminator
{ {
wxCMD_LINE_NONE, wxCMD_LINE_NONE,
_T(""), wxEmptyString,
_T(""), wxEmptyString,
_T(""), wxEmptyString,
wxCMD_LINE_VAL_NONE, wxCMD_LINE_VAL_NONE,
0x0 0x0
} }

View File

@@ -249,7 +249,7 @@ wxString wxCommandProcessor::GetUndoMenuLabel() const
{ {
wxCommand *command = (wxCommand *)m_currentCommand->GetData(); wxCommand *command = (wxCommand *)m_currentCommand->GetData();
wxString commandName(command->GetName()); wxString commandName(command->GetName());
if (commandName == wxT("")) commandName = _("Unnamed command"); if (commandName.empty()) commandName = _("Unnamed command");
bool canUndo = command->CanUndo(); bool canUndo = command->CanUndo();
if (canUndo) if (canUndo)
buf = wxString(_("&Undo ")) + commandName + m_undoAccelerator; buf = wxString(_("&Undo ")) + commandName + m_undoAccelerator;
@@ -275,7 +275,7 @@ wxString wxCommandProcessor::GetRedoMenuLabel() const
{ {
wxCommand *redoCommand = (wxCommand *)m_currentCommand->GetNext()->GetData(); wxCommand *redoCommand = (wxCommand *)m_currentCommand->GetNext()->GetData();
wxString redoCommandName(redoCommand->GetName()); wxString redoCommandName(redoCommand->GetName());
if (redoCommandName == wxT("")) redoCommandName = _("Unnamed command"); if (redoCommandName.empty()) redoCommandName = _("Unnamed command");
buf = wxString(_("&Redo ")) + redoCommandName + m_redoAccelerator; buf = wxString(_("&Redo ")) + redoCommandName + m_redoAccelerator;
} }
else else
@@ -295,7 +295,7 @@ wxString wxCommandProcessor::GetRedoMenuLabel() const
// we've undone to the start of the list, but can redo the first. // we've undone to the start of the list, but can redo the first.
wxCommand *redoCommand = (wxCommand *)m_commands.GetFirst()->GetData(); wxCommand *redoCommand = (wxCommand *)m_commands.GetFirst()->GetData();
wxString redoCommandName(redoCommand->GetName()); wxString redoCommandName(redoCommand->GetName());
if (redoCommandName == wxT("")) redoCommandName = _("Unnamed command"); if (redoCommandName.empty()) redoCommandName = _("Unnamed command");
buf = wxString(_("&Redo ")) + redoCommandName + m_redoAccelerator; buf = wxString(_("&Redo ")) + redoCommandName + m_redoAccelerator;
} }
} }

View File

@@ -177,7 +177,7 @@ wxPrintData::wxPrintData()
m_printCollate = false; m_printCollate = false;
// New, 24/3/99 // New, 24/3/99
m_printerName = wxT(""); m_printerName = wxEmptyString;
m_colour = true; m_colour = true;
m_duplexMode = wxDUPLEX_SIMPLEX; m_duplexMode = wxDUPLEX_SIMPLEX;
m_printQuality = wxPRINT_QUALITY_HIGH; m_printQuality = wxPRINT_QUALITY_HIGH;
@@ -280,7 +280,7 @@ wxString wxPrintData::GetPrinterCommand() const
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData)) if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterCommand(); return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterCommand();
#endif #endif
return wxT(""); return wxEmptyString;
} }
wxString wxPrintData::GetPrinterOptions() const wxString wxPrintData::GetPrinterOptions() const
@@ -289,7 +289,7 @@ wxString wxPrintData::GetPrinterOptions() const
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData)) if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterOptions(); return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterOptions();
#endif #endif
return wxT(""); return wxEmptyString;
} }
wxString wxPrintData::GetPreviewCommand() const wxString wxPrintData::GetPreviewCommand() const
@@ -298,7 +298,7 @@ wxString wxPrintData::GetPreviewCommand() const
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData)) if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPreviewCommand(); return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPreviewCommand();
#endif #endif
return wxT(""); return wxEmptyString;
} }
wxString wxPrintData::GetFontMetricPath() const wxString wxPrintData::GetFontMetricPath() const
@@ -307,7 +307,7 @@ wxString wxPrintData::GetFontMetricPath() const
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData)) if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
return ((wxPostScriptPrintNativeData*)m_nativeData)->GetFontMetricPath(); return ((wxPostScriptPrintNativeData*)m_nativeData)->GetFontMetricPath();
#endif #endif
return wxT(""); return wxEmptyString;
} }
double wxPrintData::GetPrinterScaleX() const double wxPrintData::GetPrinterScaleX() const

View File

@@ -99,7 +99,7 @@ size_t wxDir::Traverse(wxDirTraverser& sink,
if ( flags & wxDIR_DIRS ) if ( flags & wxDIR_DIRS )
{ {
wxString dirname; wxString dirname;
for ( bool cont = GetFirst(&dirname, _T(""), wxDIR_DIRS | (flags & wxDIR_HIDDEN) ); for ( bool cont = GetFirst(&dirname, wxEmptyString, wxDIR_DIRS | (flags & wxDIR_HIDDEN) );
cont; cont;
cont = cont && GetNext(&dirname) ) cont = cont && GetNext(&dirname) )
{ {

View File

@@ -105,7 +105,7 @@ wxSizer *wxDialogBase::CreateTextSizer( const wxString& message )
{ {
wxStaticText *s = new wxStaticText( this, wxID_ANY, line ); wxStaticText *s = new wxStaticText( this, wxID_ANY, line );
box->Add( s ); box->Add( s );
line = wxT(""); line = wxEmptyString;
} }
else else
{ {
@@ -148,7 +148,7 @@ wxSizer *wxDialogBase::CreateTextSizer( const wxString& message )
pos = last_space; pos = last_space;
last_space = 0; last_space = 0;
line = wxT(""); line = wxEmptyString;
} }
} }
} }

View File

@@ -68,7 +68,7 @@ void wxDocMDIParentFrame::Init()
void wxDocMDIParentFrame::OnMRUFile(wxCommandEvent& event) void wxDocMDIParentFrame::OnMRUFile(wxCommandEvent& event)
{ {
wxString f(m_docManager->GetHistoryFile(event.GetId() - wxID_FILE1)); wxString f(m_docManager->GetHistoryFile(event.GetId() - wxID_FILE1));
if (f != wxT("")) if (!f.empty())
(void)m_docManager->CreateDocument(f, wxDOC_SILENT); (void)m_docManager->CreateDocument(f, wxDOC_SILENT);
} }

View File

@@ -269,7 +269,7 @@ bool wxDocument::SaveAs()
t->GetDocClassInfo() == docTemplate->GetDocClassInfo()) t->GetDocClassInfo() == docTemplate->GetDocClassInfo())
{ {
// add a '|' to separate this filter from the previous one // add a '|' to separate this filter from the previous one
if ( !filter.IsEmpty() ) if ( !filter.empty() )
filter << wxT('|'); filter << wxT('|');
filter << t->GetDescription() << wxT(" (") << t->GetFileFilter() << wxT(") |") filter << t->GetDescription() << wxT(" (") << t->GetFileFilter() << wxT(") |")
@@ -290,14 +290,14 @@ bool wxDocument::SaveAs()
wxSAVE | wxOVERWRITE_PROMPT, wxSAVE | wxOVERWRITE_PROMPT,
GetDocumentWindow()); GetDocumentWindow());
if (tmp.IsEmpty()) if (tmp.empty())
return false; return false;
wxString fileName(tmp); wxString fileName(tmp);
wxString path, name, ext; wxString path, name, ext;
wxSplitPath(fileName, & path, & name, & ext); wxSplitPath(fileName, & path, & name, & ext);
if (ext.IsEmpty() || ext == wxT("")) if (ext.empty())
{ {
fileName += wxT("."); fileName += wxT(".");
fileName += docTemplate->GetDefaultExtension(); fileName += docTemplate->GetDefaultExtension();
@@ -395,12 +395,12 @@ bool wxDocument::Revert()
// Get title, or filename if no title, else unnamed // Get title, or filename if no title, else unnamed
bool wxDocument::GetPrintableName(wxString& buf) const bool wxDocument::GetPrintableName(wxString& buf) const
{ {
if (m_documentTitle != wxT("")) if (!m_documentTitle.empty())
{ {
buf = m_documentTitle; buf = m_documentTitle;
return true; return true;
} }
else if (m_documentFile != wxT("")) else if (!m_documentFile.empty())
{ {
buf = wxFileNameFromPath(m_documentFile); buf = wxFileNameFromPath(m_documentFile);
return true; return true;
@@ -435,7 +435,7 @@ bool wxDocument::OnSaveModified()
GetPrintableName(title); GetPrintableName(title);
wxString msgTitle; wxString msgTitle;
if (wxTheApp->GetAppName() != wxT("")) if (!wxTheApp->GetAppName().empty())
msgTitle = wxTheApp->GetAppName(); msgTitle = wxTheApp->GetAppName();
else else
msgTitle = wxString(_("Warning")); msgTitle = wxString(_("Warning"));
@@ -545,7 +545,7 @@ void wxDocument::SetFilename(const wxString& filename, bool notifyViews)
bool wxDocument::DoSaveDocument(const wxString& file) bool wxDocument::DoSaveDocument(const wxString& file)
{ {
wxString msgTitle; wxString msgTitle;
if (wxTheApp->GetAppName() != wxT("")) if (!wxTheApp->GetAppName().empty())
msgTitle = wxTheApp->GetAppName(); msgTitle = wxTheApp->GetAppName();
else else
msgTitle = wxString(_("File error")); msgTitle = wxString(_("File error"));
@@ -577,7 +577,7 @@ bool wxDocument::DoSaveDocument(const wxString& file)
bool wxDocument::DoOpenDocument(const wxString& file) bool wxDocument::DoOpenDocument(const wxString& file)
{ {
wxString msgTitle; wxString msgTitle;
if (wxTheApp->GetAppName() != wxT("")) if (!wxTheApp->GetAppName().empty())
msgTitle = wxTheApp->GetAppName(); msgTitle = wxTheApp->GetAppName();
else else
msgTitle = wxString(_("File error")); msgTitle = wxString(_("File error"));
@@ -950,12 +950,12 @@ void wxDocManager::OnFileCloseAll(wxCommandEvent& WXUNUSED(event))
void wxDocManager::OnFileNew(wxCommandEvent& WXUNUSED(event)) void wxDocManager::OnFileNew(wxCommandEvent& WXUNUSED(event))
{ {
CreateDocument( wxT(""), wxDOC_NEW ); CreateDocument( wxEmptyString, wxDOC_NEW );
} }
void wxDocManager::OnFileOpen(wxCommandEvent& WXUNUSED(event)) void wxDocManager::OnFileOpen(wxCommandEvent& WXUNUSED(event))
{ {
if ( !CreateDocument( wxT(""), 0) ) if ( !CreateDocument( wxEmptyString, 0) )
{ {
OnOpenFileFailure(); OnOpenFileFailure();
} }
@@ -1239,9 +1239,7 @@ wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags)
// Existing document // Existing document
wxDocTemplate *temp; wxDocTemplate *temp;
wxString path2(wxT("")); wxString path2 = path;
if (path != wxT(""))
path2 = path;
if (flags & wxDOC_SILENT) if (flags & wxDOC_SILENT)
{ {
@@ -1523,7 +1521,7 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates,
if (templates[i]->IsVisible()) if (templates[i]->IsVisible())
{ {
// add a '|' to separate this filter from the previous one // add a '|' to separate this filter from the previous one
if ( !descrBuf.IsEmpty() ) if ( !descrBuf.empty() )
descrBuf << wxT('|'); descrBuf << wxT('|');
descrBuf << templates[i]->GetDescription() descrBuf << templates[i]->GetDescription()
@@ -1541,19 +1539,19 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates,
wxString pathTmp = wxFileSelectorEx(_("Select a file"), wxString pathTmp = wxFileSelectorEx(_("Select a file"),
m_lastDirectory, m_lastDirectory,
wxT(""), wxEmptyString,
&FilterIndex, &FilterIndex,
descrBuf, descrBuf,
0, 0,
parent); parent);
wxDocTemplate *theTemplate = (wxDocTemplate *)NULL; wxDocTemplate *theTemplate = (wxDocTemplate *)NULL;
if (!pathTmp.IsEmpty()) if (!pathTmp.empty())
{ {
if (!wxFileExists(pathTmp)) if (!wxFileExists(pathTmp))
{ {
wxString msgTitle; wxString msgTitle;
if (!wxTheApp->GetAppName().IsEmpty()) if (!wxTheApp->GetAppName().empty())
msgTitle = wxTheApp->GetAppName(); msgTitle = wxTheApp->GetAppName();
else else
msgTitle = wxString(_("File error")); msgTitle = wxString(_("File error"));
@@ -1561,7 +1559,7 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates,
(void)wxMessageBox(_("Sorry, could not open this file."), msgTitle, wxOK | wxICON_EXCLAMATION, (void)wxMessageBox(_("Sorry, could not open this file."), msgTitle, wxOK | wxICON_EXCLAMATION,
parent); parent);
path = wxT(""); path = wxEmptyString;
return (wxDocTemplate *) NULL; return (wxDocTemplate *) NULL;
} }
m_lastDirectory = wxPathOnly(pathTmp); m_lastDirectory = wxPathOnly(pathTmp);
@@ -1585,7 +1583,7 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates,
} }
else else
{ {
path = wxT(""); path = wxEmptyString;
} }
return theTemplate; return theTemplate;
@@ -1898,7 +1896,7 @@ void wxDocParentFrame::OnMRUFile(wxCommandEvent& event)
{ {
int n = event.GetId() - wxID_FILE1; // the index in MRU list int n = event.GetId() - wxID_FILE1; // the index in MRU list
wxString filename(m_docManager->GetHistoryFile(n)); wxString filename(m_docManager->GetHistoryFile(n));
if ( !filename.IsEmpty() ) if ( !filename.empty() )
{ {
// verify that the file exists before doing anything else // verify that the file exists before doing anything else
if ( wxFile::Exists(filename) ) if ( wxFile::Exists(filename) )
@@ -2230,12 +2228,12 @@ void wxFileHistory::Load(wxConfigBase& config)
wxString buf; wxString buf;
buf.Printf(wxT("file%d"), (int)m_fileHistoryN+1); buf.Printf(wxT("file%d"), (int)m_fileHistoryN+1);
wxString historyFile; wxString historyFile;
while ((m_fileHistoryN < m_fileMaxFiles) && config.Read(buf, &historyFile) && (historyFile != wxT(""))) while ((m_fileHistoryN < m_fileMaxFiles) && config.Read(buf, &historyFile) && (!historyFile.empty()))
{ {
m_fileHistory[m_fileHistoryN] = MYcopystring((const wxChar*) historyFile); m_fileHistory[m_fileHistoryN] = MYcopystring((const wxChar*) historyFile);
m_fileHistoryN ++; m_fileHistoryN ++;
buf.Printf(wxT("file%d"), (int)m_fileHistoryN+1); buf.Printf(wxT("file%d"), (int)m_fileHistoryN+1);
historyFile = wxT(""); historyFile = wxEmptyString;
} }
AddFilesToMenu(); AddFilesToMenu();
} }

View File

@@ -61,7 +61,7 @@ WX_DEFINE_USER_EXPORTED_OBJARRAY(wxDynamicLibraryDetailsArray);
#if defined(__WXPM__) || defined(__EMX__) #if defined(__WXPM__) || defined(__EMX__)
const wxChar *wxDynamicLibrary::ms_dllext = _T(".dll"); const wxChar *wxDynamicLibrary::ms_dllext = _T(".dll");
#elif defined(__WXMAC__) && !defined(__DARWIN__) #elif defined(__WXMAC__) && !defined(__DARWIN__)
const wxChar *wxDynamicLibrary::ms_dllext = _T(""); const wxChar *wxDynamicLibrary::ms_dllext = wxEmptyString;
#endif #endif
// for Unix it is in src/unix/dlunix.cpp // for Unix it is in src/unix/dlunix.cpp

View File

@@ -379,7 +379,7 @@ wxString wxFileConfig::GetLocalFileName(const wxChar *szFile)
void wxFileConfig::Init() void wxFileConfig::Init()
{ {
m_pCurrentGroup = m_pCurrentGroup =
m_pRootGroup = new wxFileConfigGroup(NULL, wxT(""), this); m_pRootGroup = new wxFileConfigGroup(NULL, wxEmptyString, this);
m_linesHead = m_linesHead =
m_linesTail = NULL; m_linesTail = NULL;
@@ -387,7 +387,7 @@ void wxFileConfig::Init()
// It's not an error if (one of the) file(s) doesn't exist. // It's not an error if (one of the) file(s) doesn't exist.
// parse the global file // parse the global file
if ( !m_strGlobalFile.IsEmpty() && wxFile::Exists(m_strGlobalFile) ) if ( !m_strGlobalFile.empty() && wxFile::Exists(m_strGlobalFile) )
{ {
wxTextFile fileGlobal(m_strGlobalFile); wxTextFile fileGlobal(m_strGlobalFile);
@@ -403,7 +403,7 @@ void wxFileConfig::Init()
} }
// parse the local file // parse the local file
if ( !m_strLocalFile.IsEmpty() && wxFile::Exists(m_strLocalFile) ) if ( !m_strLocalFile.empty() && wxFile::Exists(m_strLocalFile) )
{ {
wxTextFile fileLocal(m_strLocalFile); wxTextFile fileLocal(m_strLocalFile);
if ( fileLocal.Open(m_conv/*ignored in ANSI build*/) ) if ( fileLocal.Open(m_conv/*ignored in ANSI build*/) )
@@ -431,32 +431,32 @@ wxFileConfig::wxFileConfig(const wxString& appName, const wxString& vendorName,
m_conv(conv) m_conv(conv)
{ {
// Make up names for files if empty // Make up names for files if empty
if ( m_strLocalFile.IsEmpty() && (style & wxCONFIG_USE_LOCAL_FILE) ) if ( m_strLocalFile.empty() && (style & wxCONFIG_USE_LOCAL_FILE) )
m_strLocalFile = GetLocalFileName(GetAppName()); m_strLocalFile = GetLocalFileName(GetAppName());
if ( m_strGlobalFile.IsEmpty() && (style & wxCONFIG_USE_GLOBAL_FILE) ) if ( m_strGlobalFile.empty() && (style & wxCONFIG_USE_GLOBAL_FILE) )
m_strGlobalFile = GetGlobalFileName(GetAppName()); m_strGlobalFile = GetGlobalFileName(GetAppName());
// Check if styles are not supplied, but filenames are, in which case // Check if styles are not supplied, but filenames are, in which case
// add the correct styles. // add the correct styles.
if ( !m_strLocalFile.IsEmpty() ) if ( !m_strLocalFile.empty() )
SetStyle(GetStyle() | wxCONFIG_USE_LOCAL_FILE); SetStyle(GetStyle() | wxCONFIG_USE_LOCAL_FILE);
if ( !m_strGlobalFile.IsEmpty() ) if ( !m_strGlobalFile.empty() )
SetStyle(GetStyle() | wxCONFIG_USE_GLOBAL_FILE); SetStyle(GetStyle() | wxCONFIG_USE_GLOBAL_FILE);
// if the path is not absolute, prepend the standard directory to it // if the path is not absolute, prepend the standard directory to it
// UNLESS wxCONFIG_USE_RELATIVE_PATH style is set // UNLESS wxCONFIG_USE_RELATIVE_PATH style is set
if ( !(style & wxCONFIG_USE_RELATIVE_PATH) ) if ( !(style & wxCONFIG_USE_RELATIVE_PATH) )
{ {
if ( !m_strLocalFile.IsEmpty() && !wxIsAbsolutePath(m_strLocalFile) ) if ( !m_strLocalFile.empty() && !wxIsAbsolutePath(m_strLocalFile) )
{ {
wxString strLocal = m_strLocalFile; wxString strLocal = m_strLocalFile;
m_strLocalFile = GetLocalDir(); m_strLocalFile = GetLocalDir();
m_strLocalFile << strLocal; m_strLocalFile << strLocal;
} }
if ( !m_strGlobalFile.IsEmpty() && !wxIsAbsolutePath(m_strGlobalFile) ) if ( !m_strGlobalFile.empty() && !wxIsAbsolutePath(m_strGlobalFile) )
{ {
wxString strGlobal = m_strGlobalFile; wxString strGlobal = m_strGlobalFile;
m_strGlobalFile = GetGlobalDir(); m_strGlobalFile = GetGlobalDir();
@@ -478,7 +478,7 @@ wxFileConfig::wxFileConfig(wxInputStream &inStream, wxMBConv& conv)
SetStyle(GetStyle() | wxCONFIG_USE_LOCAL_FILE); SetStyle(GetStyle() | wxCONFIG_USE_LOCAL_FILE);
m_pCurrentGroup = m_pCurrentGroup =
m_pRootGroup = new wxFileConfigGroup(NULL, wxT(""), this); m_pRootGroup = new wxFileConfigGroup(NULL, wxEmptyString, this);
m_linesHead = m_linesHead =
m_linesTail = NULL; m_linesTail = NULL;
@@ -741,7 +741,7 @@ void wxFileConfig::SetPath(const wxString& strPath)
{ {
wxArrayString aParts; wxArrayString aParts;
if ( strPath.IsEmpty() ) { if ( strPath.empty() ) {
SetRootPath(); SetRootPath();
return; return;
} }
@@ -903,11 +903,11 @@ bool wxFileConfig::DoWriteString(const wxString& key, const wxString& szValue)
szValue.c_str(), szValue.c_str(),
GetPath().c_str() ); GetPath().c_str() );
if ( strName.IsEmpty() ) if ( strName.empty() )
{ {
// setting the value of a group is an error // setting the value of a group is an error
wxASSERT_MSG( wxIsEmpty(szValue), wxT("can't set value of a group!") ); wxASSERT_MSG( szValue.empty(), wxT("can't set value of a group!") );
// ... except if it's empty in which case it's a way to force it's creation // ... except if it's empty in which case it's a way to force it's creation
@@ -1126,7 +1126,7 @@ bool wxFileConfig::DeleteAll()
} }
m_strLocalFile = m_strLocalFile =
m_strGlobalFile = wxT(""); m_strGlobalFile = wxEmptyString;
} }
Init(); Init();
@@ -1767,7 +1767,7 @@ wxFileConfigEntry::wxFileConfigEntry(wxFileConfigGroup *pParent,
int nLine) int nLine)
: m_strName(strName) : m_strName(strName)
{ {
wxASSERT( !strName.IsEmpty() ); wxASSERT( !strName.empty() );
m_pParent = pParent; m_pParent = pParent;
m_nLine = nLine; m_nLine = nLine;
@@ -1893,7 +1893,7 @@ static wxString FilterInValue(const wxString& str)
wxString strResult; wxString strResult;
strResult.Alloc(str.Len()); strResult.Alloc(str.Len());
bool bQuoted = !str.IsEmpty() && str[0] == '"'; bool bQuoted = !str.empty() && str[0] == '"';
for ( size_t n = bQuoted ? 1 : 0; n < str.Len(); n++ ) { for ( size_t n = bQuoted ? 1 : 0; n < str.Len(); n++ ) {
if ( str[n] == wxT('\\') ) { if ( str[n] == wxT('\\') ) {

View File

@@ -309,7 +309,7 @@ wxFileExists (const wxString& filename)
bool bool
wxIsAbsolutePath (const wxString& filename) wxIsAbsolutePath (const wxString& filename)
{ {
if (filename != wxT("")) if (!filename.empty())
{ {
#if defined(__WXMAC__) && !defined(__DARWIN__) #if defined(__WXMAC__) && !defined(__DARWIN__)
// Classic or Carbon CodeWarrior like // Classic or Carbon CodeWarrior like
@@ -432,7 +432,7 @@ wxChar *wxRealPath (wxChar *path)
// Must be destroyed // Must be destroyed
wxChar *wxCopyAbsolutePath(const wxString& filename) wxChar *wxCopyAbsolutePath(const wxString& filename)
{ {
if (filename == wxT("")) if (filename.empty())
return (wxChar *) NULL; return (wxChar *) NULL;
if (! wxIsAbsolutePath(wxExpandPath(wxFileFunctionsBuffer, filename))) { if (! wxIsAbsolutePath(wxExpandPath(wxFileFunctionsBuffer, filename))) {
@@ -588,7 +588,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
if (nm[1] == SEP || nm[1] == 0) if (nm[1] == SEP || nm[1] == 0)
{ /* ~/filename */ { /* ~/filename */
// FIXME: wxGetUserHome could return temporary storage in Unicode mode // FIXME: wxGetUserHome could return temporary storage in Unicode mode
if ((s = WXSTRINGCAST wxGetUserHome(wxT(""))) != NULL) { if ((s = WXSTRINGCAST wxGetUserHome(wxEmptyString)) != NULL) {
if (*++nm) if (*++nm)
nm++; nm++;
} }
@@ -647,7 +647,7 @@ wxContractPath (const wxString& filename, const wxString& envname, const wxStrin
{ {
static wxChar dest[_MAXPATHLEN]; static wxChar dest[_MAXPATHLEN];
if (filename == wxT("")) if (filename.empty())
return (wxChar *) NULL; return (wxChar *) NULL;
wxStrcpy (dest, WXSTRINGCAST filename); wxStrcpy (dest, WXSTRINGCAST filename);
@@ -683,7 +683,7 @@ wxContractPath (const wxString& filename, const wxString& envname, const wxStrin
if (wxStrncmp(dest, val, len) == 0) if (wxStrncmp(dest, val, len) == 0)
{ {
wxStrcpy(wxFileFunctionsBuffer, wxT("~")); wxStrcpy(wxFileFunctionsBuffer, wxT("~"));
if (user != wxT("")) if (!user.empty())
wxStrcat(wxFileFunctionsBuffer, (const wxChar*) user); wxStrcat(wxFileFunctionsBuffer, (const wxChar*) user);
wxStrcat(wxFileFunctionsBuffer, dest + len); wxStrcat(wxFileFunctionsBuffer, dest + len);
wxStrcpy (dest, wxFileFunctionsBuffer); wxStrcpy (dest, wxFileFunctionsBuffer);
@@ -775,7 +775,7 @@ wxPathOnly (wxChar *path)
// Return just the directory, or NULL if no directory // Return just the directory, or NULL if no directory
wxString wxPathOnly (const wxString& path) wxString wxPathOnly (const wxString& path)
{ {
if (path != wxT("")) if (!path.empty())
{ {
wxChar buf[_MAXPATHLEN]; wxChar buf[_MAXPATHLEN];
@@ -828,7 +828,7 @@ wxString wxPathOnly (const wxString& path)
} }
#endif #endif
} }
return wxString(wxT("")); return wxEmptyString;
} }
// Utility for converting delimiters in DOS filenames to UNIX style // Utility for converting delimiters in DOS filenames to UNIX style

View File

@@ -467,7 +467,7 @@ void wxFileName::Assign(const wxString& pathOrig,
void wxFileName::AssignDir(const wxString& dir, wxPathFormat format) void wxFileName::AssignDir(const wxString& dir, wxPathFormat format)
{ {
Assign(dir, _T(""), format); Assign(dir, wxEmptyString, format);
} }
void wxFileName::Clear() void wxFileName::Clear()
@@ -1075,7 +1075,7 @@ bool wxFileName::GetShortcutTarget(const wxString& shortcutPath, wxString& targe
psl->GetArguments(buf, 2048); psl->GetArguments(buf, 2048);
wxString args(buf); wxString args(buf);
if (!args.IsEmpty() && arguments) if (!args.empty() && arguments)
{ {
*arguments = args; *arguments = args;
} }

View File

@@ -64,28 +64,28 @@ wxString wxFileSystemHandler::GetMimeTypeFromExt(const wxString& location)
static const wxFileTypeInfo fallbacks[] = static const wxFileTypeInfo fallbacks[] =
{ {
wxFileTypeInfo(_T("image/jpeg"), wxFileTypeInfo(_T("image/jpeg"),
_T(""), wxEmptyString,
_T(""), wxEmptyString,
_T("JPEG image (from fallback)"), _T("JPEG image (from fallback)"),
_T("jpg"), _T("jpeg"), _T("JPG"), _T("JPEG"), NULL), _T("jpg"), _T("jpeg"), _T("JPG"), _T("JPEG"), NULL),
wxFileTypeInfo(_T("image/gif"), wxFileTypeInfo(_T("image/gif"),
_T(""), wxEmptyString,
_T(""), wxEmptyString,
_T("GIF image (from fallback)"), _T("GIF image (from fallback)"),
_T("gif"), _T("GIF"), NULL), _T("gif"), _T("GIF"), NULL),
wxFileTypeInfo(_T("image/png"), wxFileTypeInfo(_T("image/png"),
_T(""), wxEmptyString,
_T(""), wxEmptyString,
_T("PNG image (from fallback)"), _T("PNG image (from fallback)"),
_T("png"), _T("PNG"), NULL), _T("png"), _T("PNG"), NULL),
wxFileTypeInfo(_T("image/bmp"), wxFileTypeInfo(_T("image/bmp"),
_T(""), wxEmptyString,
_T(""), wxEmptyString,
_T("windows bitmap image (from fallback)"), _T("windows bitmap image (from fallback)"),
_T("bmp"), _T("BMP"), NULL), _T("bmp"), _T("BMP"), NULL),
wxFileTypeInfo(_T("text/html"), wxFileTypeInfo(_T("text/html"),
_T(""), wxEmptyString,
_T(""), wxEmptyString,
_T("HTML document (from fallback)"), _T("HTML document (from fallback)"),
_T("htm"), _T("html"), _T("HTM"), _T("HTML"), NULL), _T("htm"), _T("html"), _T("HTM"), _T("HTML"), NULL),
// must terminate the table with this! // must terminate the table with this!

View File

@@ -116,7 +116,7 @@ wxString wxFileDialogBase::AppendExtension(const wxString &filePath,
// if ext == "*" or "bar*" or "b?r" or " " then its not valid // if ext == "*" or "bar*" or "b?r" or " " then its not valid
if ((ext.Find(wxT('*')) != wxNOT_FOUND) || if ((ext.Find(wxT('*')) != wxNOT_FOUND) ||
(ext.Find(wxT('?')) != wxNOT_FOUND) || (ext.Find(wxT('?')) != wxNOT_FOUND) ||
(ext.Strip(wxString::both).IsEmpty())) (ext.Strip(wxString::both).empty()))
return filePath; return filePath;
// if fileName doesn't have a '.' then add one // if fileName doesn't have a '.' then add one
@@ -214,10 +214,10 @@ wxString wxFileSelectorEx(const wxChar *title,
{ {
wxFileDialog fileDialog(parent, wxFileDialog fileDialog(parent,
title ? title : wxT(""), title ? title : wxEmptyString,
defaultDir ? defaultDir : wxT(""), defaultDir ? defaultDir : wxEmptyString,
defaultFileName ? defaultFileName : wxT(""), defaultFileName ? defaultFileName : wxEmptyString,
filter ? filter : wxT(""), filter ? filter : wxEmptyString,
flags, wxPoint(x, y)); flags, wxPoint(x, y));
wxString filename; wxString filename;