Source cleaning: whitespaces, tabs, -1/wxID_ANY/wxDefaultCoord, TRUE/true, FALSE/false, !!/!IsEmpty().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29139 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-09-14 12:08:28 +00:00
parent a2668a908a
commit a62848fdba
29 changed files with 427 additions and 429 deletions

View File

@@ -177,7 +177,7 @@ typedef void (wxEvtHandler::*wxFindDialogEventFunction)(wxFindDialogEvent&);
#define EVT_FIND(id, fn) \
DECLARE_EVENT_TABLE_ENTRY( \
wxEVT_COMMAND_FIND, id, -1, \
wxEVT_COMMAND_FIND, id, wxID_ANY, \
(wxObjectEventFunction)(wxEventFunction)(wxFindDialogEventFunction) \
& fn, \
(wxObject *) NULL \
@@ -185,7 +185,7 @@ typedef void (wxEvtHandler::*wxFindDialogEventFunction)(wxFindDialogEvent&);
#define EVT_FIND_NEXT(id, fn) \
DECLARE_EVENT_TABLE_ENTRY( \
wxEVT_COMMAND_FIND_NEXT, id, -1, \
wxEVT_COMMAND_FIND_NEXT, id, wxID_ANY, \
(wxObjectEventFunction)(wxEventFunction)(wxFindDialogEventFunction) \
& fn, \
(wxObject *) NULL \
@@ -193,7 +193,7 @@ typedef void (wxEvtHandler::*wxFindDialogEventFunction)(wxFindDialogEvent&);
#define EVT_FIND_REPLACE(id, fn) \
DECLARE_EVENT_TABLE_ENTRY( \
wxEVT_COMMAND_FIND_REPLACE, id, -1, \
wxEVT_COMMAND_FIND_REPLACE, id, wxID_ANY, \
(wxObjectEventFunction)(wxEventFunction)(wxFindDialogEventFunction) \
& fn, \
(wxObject *) NULL \
@@ -201,7 +201,7 @@ typedef void (wxEvtHandler::*wxFindDialogEventFunction)(wxFindDialogEvent&);
#define EVT_FIND_REPLACE_ALL(id, fn) \
DECLARE_EVENT_TABLE_ENTRY( \
wxEVT_COMMAND_FIND_REPLACE_ALL, id, -1, \
wxEVT_COMMAND_FIND_REPLACE_ALL, id, wxID_ANY, \
(wxObjectEventFunction)(wxEventFunction)(wxFindDialogEventFunction) \
& fn, \
(wxObject *) NULL \
@@ -209,7 +209,7 @@ typedef void (wxEvtHandler::*wxFindDialogEventFunction)(wxFindDialogEvent&);
#define EVT_FIND_CLOSE(id, fn) \
DECLARE_EVENT_TABLE_ENTRY( \
wxEVT_COMMAND_FIND_CLOSE, id, -1, \
wxEVT_COMMAND_FIND_CLOSE, id, wxID_ANY, \
(wxObjectEventFunction)(wxEventFunction)(wxFindDialogEventFunction) \
& fn, \
(wxObject *) NULL \

View File

@@ -89,7 +89,7 @@
in the entries it reads: for example, if you have an entry
score_file = $HOME/.score
a call to Read(&str, "score_file") will return a complete path to .score file
unless the expansion was previousle disabled with SetExpandEnvVars(FALSE) call
unless the expansion was previousle disabled with SetExpandEnvVars(false) call
(it's on by default, the current status can be retrieved with
IsExpandingEnvVars function).
*/
@@ -150,18 +150,18 @@ public:
virtual bool GetFirstEntry(wxString& str, long& lIndex) const;
virtual bool GetNextEntry (wxString& str, long& lIndex) const;
virtual size_t GetNumberOfEntries(bool bRecursive = FALSE) const;
virtual size_t GetNumberOfGroups(bool bRecursive = FALSE) const;
virtual size_t GetNumberOfEntries(bool bRecursive = false) const;
virtual size_t GetNumberOfGroups(bool bRecursive = false) const;
virtual bool HasGroup(const wxString& strName) const;
virtual bool HasEntry(const wxString& strName) const;
virtual bool Flush(bool bCurrentOnly = FALSE);
virtual bool Flush(bool bCurrentOnly = false);
virtual bool RenameEntry(const wxString& oldName, const wxString& newName);
virtual bool RenameGroup(const wxString& oldName, const wxString& newName);
virtual bool DeleteEntry(const wxString& key, bool bGroupIfEmptyAlso = TRUE);
virtual bool DeleteEntry(const wxString& key, bool bGroupIfEmptyAlso = true);
virtual bool DeleteGroup(const wxString& szKey);
virtual bool DeleteAll();

View File

@@ -124,7 +124,7 @@ wxFileSelector(const wxChar *message = wxFileSelectorPromptStr,
const wxChar *wildcard = wxFileSelectorDefaultWildcardStr,
int flags = 0,
wxWindow *parent = NULL,
int x = -1, int y = -1);
int x = wxDefaultCoord, int y = wxDefaultCoord);
// An extended version of wxFileSelector
WXDLLEXPORT wxString
@@ -135,7 +135,7 @@ wxFileSelectorEx(const wxChar *message = wxFileSelectorPromptStr,
const wxChar *wildcard = wxFileSelectorDefaultWildcardStr,
int flags = 0,
wxWindow *parent = NULL,
int x = -1, int y = -1);
int x = wxDefaultCoord, int y = wxDefaultCoord);
// Ask for filename to load
WXDLLEXPORT wxString

View File

@@ -237,16 +237,16 @@ WXDLLIMPEXP_BASE wxString wxFindNextFile();
WXDLLIMPEXP_BASE bool wxIsWild(const wxString& pattern);
// Does the pattern match the text (usually a filename)?
// If dot_special is TRUE, doesn't match * against . (eliminating
// If dot_special is true, doesn't match * against . (eliminating
// `hidden' dot files)
WXDLLIMPEXP_BASE bool wxMatchWild(const wxString& pattern, const wxString& text, bool dot_special = TRUE);
WXDLLIMPEXP_BASE bool wxMatchWild(const wxString& pattern, const wxString& text, bool dot_special = true);
// Concatenate two files to form third
WXDLLIMPEXP_BASE bool wxConcatFiles(const wxString& file1, const wxString& file2, const wxString& file3);
// Copy file1 to file2
WXDLLIMPEXP_BASE bool wxCopyFile(const wxString& file1, const wxString& file2,
bool overwrite = TRUE);
bool overwrite = true);
// Remove file
WXDLLIMPEXP_BASE bool wxRemoveFile(const wxString& file);
@@ -316,9 +316,9 @@ WXDLLIMPEXP_BASE bool wxRmdir(const wxString& dir, int flags = 0);
// this is useful for wxString::IsSameAs(): to compare two file names use
// filename1.IsSameAs(filename2, wxARE_FILENAMES_CASE_SENSITIVE)
#if defined(__UNIX__) && !defined(__DARWIN__) && !defined(__OS2__)
#define wxARE_FILENAMES_CASE_SENSITIVE TRUE
#define wxARE_FILENAMES_CASE_SENSITIVE true
#else // Windows, Mac OS and OS/2
#define wxARE_FILENAMES_CASE_SENSITIVE FALSE
#define wxARE_FILENAMES_CASE_SENSITIVE false
#endif // Unix/Windows
// is the char a path separator?
@@ -381,7 +381,7 @@ public:
wxString FindAbsoluteValidPath(const wxString& filename);
// Given full path and filename, add path to list
void EnsureFileAccessible(const wxString& path);
// Returns TRUE if the path is in the list
// Returns true if the path is in the list
bool Member(const wxString& path);
private:

View File

@@ -107,7 +107,7 @@ class WXDLLIMPEXP_BASE wxFileSystemHandler : public wxObject
public:
wxFileSystemHandler() : wxObject() {}
// returns TRUE if this handler is able to open given location
// returns true if this handler is able to open given location
virtual bool CanOpen(const wxString& location) = 0;
// opens given file and returns pointer to input stream.
@@ -165,10 +165,10 @@ public:
// sets the current location. Every call to OpenFile is
// relative to this location.
// NOTE !!
// unless is_dir = TRUE 'location' is *not* the directory but
// unless is_dir = true 'location' is *not* the directory but
// file contained in this directory
// (so ChangePathTo("dir/subdir/xh.htm") sets m_Path to "dir/subdir/")
void ChangePathTo(const wxString& location, bool is_dir = FALSE);
void ChangePathTo(const wxString& location, bool is_dir = false);
wxString GetPath() const {return m_Path;}

View File

@@ -123,7 +123,7 @@ public:
int family, // see wxFontFamily enum
int style, // see wxFontStyle enum
int weight, // see wxFontWeight enum
bool underlined = FALSE, // not underlined by default
bool underlined = false, // not underlined by default
const wxString& face = wxEmptyString, // facename
wxFontEncoding encoding = wxFONTENCODING_DEFAULT); // ISO8859-X, ...
@@ -184,8 +184,8 @@ public:
wxString GetWeightString() const;
// Unofficial API, don't use
virtual void SetNoAntiAliasing( bool WXUNUSED(no) = TRUE ) { }
virtual bool GetNoAntiAliasing() const { return FALSE; }
virtual void SetNoAntiAliasing( bool WXUNUSED(no) = true ) { }
virtual bool GetNoAntiAliasing() const { return false; }
// the default encoding is used for creating all fonts with default
// encoding parameter

View File

@@ -51,7 +51,7 @@ public:
{ InitFontData(data); return Create(parent); }
protected:
virtual bool DoCreate(wxWindow *parent) { m_parent = parent; return TRUE; }
virtual bool DoCreate(wxWindow *parent) { m_parent = parent; return true; }
void InitFontData(const wxFontData *data = NULL)
{ if ( data ) m_fontData = *data; }

View File

@@ -92,7 +92,7 @@ private:
inline bool HasElements() const;
public:
// init the elements from an XLFD, return TRUE if ok
// init the elements from an XLFD, return true if ok
bool FromXFontName(const wxString& xFontName);
// return false if we were never initialized with a valid XLFD
@@ -211,13 +211,13 @@ public:
// ----------------------------------------------------------------------------
// translate a wxFontEncoding into native encoding parameter (defined above),
// returning TRUE if an (exact) macth could be found, FALSE otherwise (without
// returning true if an (exact) macth could be found, false otherwise (without
// attempting any substitutions)
extern bool wxGetNativeFontEncoding(wxFontEncoding encoding,
wxNativeEncodingInfo *info);
// test for the existence of the font described by this facename/encoding,
// return TRUE if such font(s) exist, FALSE otherwise
// return true if such font(s) exist, false otherwise
extern bool wxTestFontEncoding(const wxNativeEncodingInfo& info);
// ----------------------------------------------------------------------------

View File

@@ -91,7 +91,7 @@ public:
virtual wxMenuBar *GetMenuBar() const { return m_frameMenuBar; }
#endif // wxUSE_MENUS
// process menu command: returns TRUE if processed
// process menu command: returns true if processed
bool ProcessCommand(int winid);
// status bar functions
@@ -132,7 +132,7 @@ public:
#if wxUSE_TOOLBAR
// create main toolbar bycalling OnCreateToolBar()
virtual wxToolBar* CreateToolBar(long style = -1,
wxWindowID winid = -1,
wxWindowID winid = wxID_ANY,
const wxString& name = wxToolBarNameStr);
// return a new toolbar
virtual wxToolBar *OnCreateToolBar(long style,
@@ -172,13 +172,13 @@ public:
#ifndef wxTopLevelWindowNative
virtual bool ShowFullScreen(bool WXUNUSED(show),
long WXUNUSED(style) = wxFULLSCREEN_ALL)
{ return FALSE; }
{ return false; }
virtual bool IsFullScreen() const
{ return FALSE; }
{ return false; }
#endif // no wxTopLevelWindowNative
// show help text (typically in the statusbar); show is FALSE
// if you are hiding the help, TRUE otherwise
// show help text (typically in the statusbar); show is false
// if you are hiding the help, true otherwise
virtual void DoGiveHelp(const wxString& text, bool show);
#if WXWIN_COMPATIBILITY_2_2
@@ -223,7 +223,7 @@ protected:
virtual void PositionStatusBar() { }
// show the help string for this menu item in the given status bar: the
// status bar pointer can be NULL; return TRUE if help was shown
// status bar pointer can be NULL; return true if help was shown
bool ShowMenuHelp(wxStatusBar *statbar, int helpid);
wxStatusBar *m_frameStatusBar;

View File

@@ -62,12 +62,12 @@ bool wxFFile::Open(const wxChar *filename, const wxChar *mode)
{
wxLogSysError(_("can't open file '%s'"), filename);
return FALSE;
return false;
}
m_name = filename;
return TRUE;
return true;
}
bool wxFFile::Close()
@@ -78,13 +78,13 @@ bool wxFFile::Close()
{
wxLogSysError(_("can't close file '%s'"), m_name.c_str());
return FALSE;
return false;
}
Detach();
}
return TRUE;
return true;
}
// ----------------------------------------------------------------------------
@@ -93,8 +93,8 @@ bool wxFFile::Close()
bool wxFFile::ReadAll(wxString *str)
{
wxCHECK_MSG( str, FALSE, wxT("invalid parameter") );
wxCHECK_MSG( IsOpened(), FALSE, wxT("can't read from closed file") );
wxCHECK_MSG( str, false, wxT("invalid parameter") );
wxCHECK_MSG( IsOpened(), false, wxT("can't read from closed file") );
clearerr(m_fp);
@@ -110,7 +110,7 @@ bool wxFFile::ReadAll(wxString *str)
{
wxLogSysError(_("Read error on file '%s'"), m_name.c_str());
return FALSE;
return false;
}
//else: just EOF
@@ -118,7 +118,7 @@ bool wxFFile::ReadAll(wxString *str)
*str += buf;
}
return TRUE;
return true;
}
size_t wxFFile::Read(void *pBuf, size_t nCount)
@@ -159,11 +159,11 @@ bool wxFFile::Flush()
{
wxLogSysError(_("failed to flush the file '%s'"), m_name.c_str());
return FALSE;
return false;
}
}
return TRUE;
return true;
}
// ----------------------------------------------------------------------------
@@ -172,7 +172,7 @@ bool wxFFile::Flush()
bool wxFFile::Seek(long ofs, wxSeekMode mode)
{
wxCHECK_MSG( IsOpened(), FALSE, wxT("can't seek on closed file") );
wxCHECK_MSG( IsOpened(), false, wxT("can't seek on closed file") );
int origin;
switch ( mode )
@@ -198,10 +198,10 @@ bool wxFFile::Seek(long ofs, wxSeekMode mode)
{
wxLogSysError(_("Seek error on file '%s'"), m_name.c_str());
return FALSE;
return false;
}
return TRUE;
return true;
}
size_t wxFFile::Tell() const

View File

@@ -202,7 +202,7 @@ bool wxFile::Access(const wxChar *name, OpenMode mode)
#ifdef __WXWINCE__
// FIXME: use CreateFile with 0 access to query the file
return TRUE;
return true;
#else
return wxAccess(name, how) == 0;
#endif
@@ -216,7 +216,7 @@ bool wxFile::Access(const wxChar *name, OpenMode mode)
wxFile::wxFile(const wxChar *szFileName, OpenMode mode)
{
m_fd = fd_invalid;
m_error = FALSE;
m_error = false;
Open(szFileName, mode);
}
@@ -250,12 +250,12 @@ bool wxFile::Create(const wxChar *szFileName, bool bOverwrite, int accessMode)
if ( fd == -1 )
{
wxLogSysError(_("can't create file '%s'"), szFileName);
return FALSE;
return false;
}
else
{
Attach(fd);
return TRUE;
return true;
}
}
@@ -357,11 +357,11 @@ bool wxFile::Open(const wxChar *szFileName, OpenMode mode, int accessMode)
if ( fd == -1 )
{
wxLogSysError(_("can't open file '%s'"), szFileName);
return FALSE;
return false;
}
else {
Attach(fd);
return TRUE;
return true;
}
}
@@ -377,13 +377,13 @@ bool wxFile::Close()
{
wxLogSysError(_("can't close file descriptor %d"), m_fd);
m_fd = fd_invalid;
return FALSE;
return false;
}
else
m_fd = fd_invalid;
}
return TRUE;
return true;
}
// ----------------------------------------------------------------------------
@@ -438,7 +438,7 @@ size_t wxFile::Write(const void *pBuf, size_t nCount)
#endif
if ( iRc == -1 ) {
wxLogSysError(_("can't write to file descriptor %d"), m_fd);
m_error = TRUE;
m_error = true;
return 0;
}
else
@@ -455,14 +455,14 @@ bool wxFile::Flush()
if ( wxFsync(m_fd) == -1 )
{
wxLogSysError(_("can't flush file descriptor %d"), m_fd);
return FALSE;
return false;
}
#else // no fsync
// just do nothing
#endif // fsync
}
return TRUE;
return true;
}
// ----------------------------------------------------------------------------
@@ -606,11 +606,11 @@ bool wxFile::Eof() const
DWORD off0 = SetFilePointer((HANDLE) m_fd, 0, 0, FILE_CURRENT);
DWORD off1 = SetFilePointer((HANDLE) m_fd, 0, 0, FILE_END);
if (off0 == off1)
return TRUE;
return true;
else
{
SetFilePointer((HANDLE) m_fd, off0, 0, FILE_BEGIN);
return FALSE;
return false;
}
#else
int iRc;
@@ -632,7 +632,7 @@ bool wxFile::Eof() const
break;
case 0:
return FALSE;
return false;
case -1:
wxLogSysError(_("can't determine if the end of file is reached on descriptor %d"), m_fd);
@@ -642,7 +642,7 @@ bool wxFile::Eof() const
wxFAIL_MSG(_("invalid eof() return value."));
}
return TRUE;
return true;
#endif
}
@@ -681,7 +681,7 @@ bool wxTempFile::Open(const wxString& strName)
if ( m_strTemp.empty() )
{
// CreateTempFileName() failed
return FALSE;
return false;
}
#ifdef __UNIX__
@@ -710,7 +710,7 @@ bool wxTempFile::Open(const wxString& strName)
}
#endif // Unix
return TRUE;
return true;
}
// ----------------------------------------------------------------------------
@@ -729,15 +729,15 @@ bool wxTempFile::Commit()
if ( wxFile::Exists(m_strName) && wxRemove(m_strName) != 0 ) {
wxLogSysError(_("can't remove file '%s'"), m_strName.c_str());
return FALSE;
return false;
}
if ( !wxRenameFile(m_strTemp, m_strName) ) {
wxLogSysError(_("can't commit changes to file '%s'"), m_strName.c_str());
return FALSE;
return false;
}
return TRUE;
return true;
}
void wxTempFile::Discard()

View File

@@ -185,7 +185,7 @@ public:
GetLine() const { return m_pLine; }
// modify entry attributes
void SetValue(const wxString& strValue, bool bUser = TRUE);
void SetValue(const wxString& strValue, bool bUser = true);
void SetDirty();
void SetLine(wxFileConfigLineList *pLine);
@@ -204,7 +204,7 @@ private:
ArrayEntries m_aEntries; // entries in this group
ArrayGroups m_aSubgroups; // subgroups
wxString m_strName; // group's name
bool m_bDirty; // if FALSE => all subgroups are not dirty
bool m_bDirty; // if false => all subgroups are not dirty
wxFileConfigLineList *m_pLine; // pointer to our line in the linked list
wxFileConfigEntry *m_pLastEntry; // last entry/subgroup of this group in the
wxFileConfigGroup *m_pLastGroup; // local file (we insert new ones after it)
@@ -233,7 +233,7 @@ public:
wxFileConfigGroup *FindSubgroup(const wxChar *szName) const;
wxFileConfigEntry *FindEntry (const wxChar *szName) const;
// delete entry/subgroup, return FALSE if doesn't exist
// delete entry/subgroup, return false if doesn't exist
bool DeleteSubgroupByName(const wxChar *szName);
bool DeleteEntry(const wxChar *szName);
@@ -293,7 +293,7 @@ wxString wxFileConfig::GetGlobalDir()
strDir.Printf(wxT("%c:\\OS2\\"), 'A'+drive-1);
}
#elif defined(__WXSTUBS__)
wxASSERT_MSG( FALSE, wxT("TODO") ) ;
wxASSERT_MSG( false, wxT("TODO") ) ;
#elif defined(__DOS__)
// There's no such thing as global cfg dir in MS-DOS, let's return
// current directory (FIXME_MGL?)
@@ -399,7 +399,7 @@ void wxFileConfig::Init()
if ( fileGlobal.Open(m_conv/*ignored in ANSI build*/) )
{
Parse(fileGlobal, FALSE /* global */);
Parse(fileGlobal, false /* global */);
SetRootPath();
}
else
@@ -414,7 +414,7 @@ void wxFileConfig::Init()
wxTextFile fileLocal(m_strLocalFile);
if ( fileLocal.Open(m_conv/*ignored in ANSI build*/) )
{
Parse(fileLocal, TRUE /* local */);
Parse(fileLocal, true /* local */);
SetRootPath();
}
else
@@ -540,7 +540,7 @@ wxFileConfig::wxFileConfig(wxInputStream &inStream, wxMBConv& conv)
memText.AddLine(strTrans);
// Finally we can parse it all.
Parse(memText, TRUE /* local */);
Parse(memText, true /* local */);
SetRootPath();
}
@@ -641,12 +641,12 @@ void wxFileConfig::Parse(wxTextBuffer& buffer, bool bLocal)
}
// check that there is nothing except comments left on this line
bool bCont = TRUE;
bool bCont = true;
while ( *++pEnd != wxT('\0') && bCont ) {
switch ( *pEnd ) {
case wxT('#'):
case wxT(';'):
bCont = FALSE;
bCont = false;
break;
case wxT(' '):
@@ -657,7 +657,7 @@ void wxFileConfig::Parse(wxTextBuffer& buffer, bool bLocal)
default:
wxLogWarning(_("file '%s', line %d: '%s' ignored after group header."),
buffer.GetName(), n + 1, pEnd);
bCont = FALSE;
bCont = false;
}
}
}
@@ -724,7 +724,7 @@ void wxFileConfig::Parse(wxTextBuffer& buffer, bool bLocal)
if ( !(GetStyle() & wxCONFIG_USE_NO_ESCAPE_CHARACTERS) )
value = FilterInValue(value);
pEntry->SetValue(value, FALSE);
pEntry->SetValue(value, false);
}
}
}
@@ -791,10 +791,10 @@ bool wxFileConfig::GetNextGroup (wxString& str, long& lIndex) const
{
if ( size_t(lIndex) < m_pCurrentGroup->Groups().Count() ) {
str = m_pCurrentGroup->Groups()[(size_t)lIndex++]->Name();
return TRUE;
return true;
}
else
return FALSE;
return false;
}
bool wxFileConfig::GetFirstEntry(wxString& str, long& lIndex) const
@@ -807,10 +807,10 @@ bool wxFileConfig::GetNextEntry (wxString& str, long& lIndex) const
{
if ( size_t(lIndex) < m_pCurrentGroup->Entries().Count() ) {
str = m_pCurrentGroup->Entries()[(size_t)lIndex++]->Name();
return TRUE;
return true;
}
else
return FALSE;
return false;
}
size_t wxFileConfig::GetNumberOfEntries(bool bRecursive) const
@@ -821,7 +821,7 @@ size_t wxFileConfig::GetNumberOfEntries(bool bRecursive) const
size_t nSubgroups = m_pCurrentGroup->Groups().Count();
for ( size_t nGroup = 0; nGroup < nSubgroups; nGroup++ ) {
CONST_CAST m_pCurrentGroup = m_pCurrentGroup->Groups()[nGroup];
n += GetNumberOfEntries(TRUE);
n += GetNumberOfEntries(true);
CONST_CAST m_pCurrentGroup = pOldCurrentGroup;
}
}
@@ -837,7 +837,7 @@ size_t wxFileConfig::GetNumberOfGroups(bool bRecursive) const
size_t nSubgroups = m_pCurrentGroup->Groups().Count();
for ( size_t nGroup = 0; nGroup < nSubgroups; nGroup++ ) {
CONST_CAST m_pCurrentGroup = m_pCurrentGroup->Groups()[nGroup];
n += GetNumberOfGroups(TRUE);
n += GetNumberOfGroups(true);
CONST_CAST m_pCurrentGroup = pOldCurrentGroup;
}
}
@@ -875,19 +875,19 @@ bool wxFileConfig::DoReadString(const wxString& key, wxString* pStr) const
wxFileConfigEntry *pEntry = m_pCurrentGroup->FindEntry(path.Name());
if (pEntry == NULL) {
return FALSE;
return false;
}
*pStr = pEntry->Value();
return TRUE;
return true;
}
bool wxFileConfig::DoReadLong(const wxString& key, long *pl) const
{
wxString str;
if ( !Read(key, &str) )
return FALSE;
return false;
// extra spaces shouldn't prevent us from reading numeric values
str.Trim();
@@ -933,7 +933,7 @@ bool wxFileConfig::DoWriteString(const wxString& key, const wxString& szValue)
{
wxLogError( _("Config entry name cannot start with '%c'."),
wxCONFIG_IMMUTABLE_PREFIX);
return FALSE;
return false;
}
wxFileConfigEntry *pEntry = m_pCurrentGroup->FindEntry(strName);
@@ -952,7 +952,7 @@ bool wxFileConfig::DoWriteString(const wxString& key, const wxString& szValue)
pEntry->SetValue(szValue);
}
return TRUE;
return true;
}
bool wxFileConfig::DoWriteLong(const wxString& key, long lValue)
@@ -963,7 +963,7 @@ bool wxFileConfig::DoWriteLong(const wxString& key, long lValue)
bool wxFileConfig::Flush(bool /* bCurrentOnly */)
{
if ( LineListIsEmpty() || !m_pRootGroup->IsDirty() || !m_strLocalFile )
return TRUE;
return true;
#ifdef __UNIX__
// set the umask if needed
@@ -979,7 +979,7 @@ bool wxFileConfig::Flush(bool /* bCurrentOnly */)
if ( !file.IsOpened() )
{
wxLogError(_("can't open user configuration file."));
return FALSE;
return false;
}
// write all strings to file
@@ -990,7 +990,7 @@ bool wxFileConfig::Flush(bool /* bCurrentOnly */)
if ( !file.Write(line, m_conv) )
{
wxLogError(_("can't write user configuration file."));
return FALSE;
return false;
}
}
@@ -1037,21 +1037,21 @@ bool wxFileConfig::RenameEntry(const wxString& oldName,
// check that the entry exists
wxFileConfigEntry *oldEntry = m_pCurrentGroup->FindEntry(oldName);
if ( !oldEntry )
return FALSE;
return false;
// check that the new entry doesn't already exist
if ( m_pCurrentGroup->FindEntry(newName) )
return FALSE;
return false;
// delete the old entry, create the new one
wxString value = oldEntry->Value();
if ( !m_pCurrentGroup->DeleteEntry(oldName) )
return FALSE;
return false;
wxFileConfigEntry *newEntry = m_pCurrentGroup->AddEntry(newName);
newEntry->SetValue(value);
return TRUE;
return true;
}
bool wxFileConfig::RenameGroup(const wxString& oldName,
@@ -1060,15 +1060,15 @@ bool wxFileConfig::RenameGroup(const wxString& oldName,
// check that the group exists
wxFileConfigGroup *group = m_pCurrentGroup->FindSubgroup(oldName);
if ( !group )
return FALSE;
return false;
// check that the new group doesn't already exist
if ( m_pCurrentGroup->FindSubgroup(newName) )
return FALSE;
return false;
group->Rename(newName);
return TRUE;
return true;
}
// ----------------------------------------------------------------------------
@@ -1080,7 +1080,7 @@ bool wxFileConfig::DeleteEntry(const wxString& key, bool bGroupIfEmptyAlso)
wxConfigPathChanger path(this, key);
if ( !m_pCurrentGroup->DeleteEntry(path.Name()) )
return FALSE;
return false;
if ( bGroupIfEmptyAlso && m_pCurrentGroup->IsEmpty() ) {
if ( m_pCurrentGroup != m_pRootGroup ) {
@@ -1091,7 +1091,7 @@ bool wxFileConfig::DeleteEntry(const wxString& key, bool bGroupIfEmptyAlso)
//else: never delete the root group
}
return TRUE;
return true;
}
bool wxFileConfig::DeleteGroup(const wxString& key)
@@ -1108,13 +1108,13 @@ bool wxFileConfig::DeleteAll()
if ( wxFile::Exists(m_strLocalFile) && wxRemove(m_strLocalFile) == -1 )
{
wxLogSysError(_("can't delete user configuration file '%s'"), m_strLocalFile.c_str());
return FALSE;
return false;
}
m_strLocalFile = m_strGlobalFile = wxT("");
Init();
return TRUE;
return true;
}
// ----------------------------------------------------------------------------
@@ -1269,7 +1269,7 @@ wxFileConfigGroup::wxFileConfigGroup(wxFileConfigGroup *pParent,
{
m_pConfig = pConfig;
m_pParent = pParent;
m_bDirty = FALSE;
m_bDirty = false;
m_pLine = NULL;
m_pLastEntry = NULL;
@@ -1565,14 +1565,14 @@ bool wxFileConfigGroup::DeleteSubgroupByName(const wxChar *szName)
{
wxFileConfigGroup * const pGroup = FindSubgroup(szName);
return pGroup ? DeleteSubgroup(pGroup) : FALSE;
return pGroup ? DeleteSubgroup(pGroup) : false;
}
// Delete the subgroup and remove all references to it from
// other data structures.
bool wxFileConfigGroup::DeleteSubgroup(wxFileConfigGroup *pGroup)
{
wxCHECK_MSG( pGroup, FALSE, _T("deleting non existing group?") );
wxCHECK_MSG( pGroup, false, _T("deleting non existing group?") );
wxLogTrace( _T("wxFileConfig"),
_T("Deleting group '%s' from '%s'"),
@@ -1706,13 +1706,13 @@ bool wxFileConfigGroup::DeleteSubgroup(wxFileConfigGroup *pGroup)
m_aSubgroups.Remove(pGroup);
delete pGroup;
return TRUE;
return true;
}
bool wxFileConfigGroup::DeleteEntry(const wxChar *szName)
{
wxFileConfigEntry *pEntry = FindEntry(szName);
wxCHECK( pEntry != NULL, FALSE ); // deleting non existing item?
wxCHECK( pEntry != NULL, false ); // deleting non existing item?
wxFileConfigLineList *pLine = pEntry->GetLine();
if ( pLine != NULL ) {
@@ -1756,7 +1756,7 @@ bool wxFileConfigGroup::DeleteEntry(const wxChar *szName)
m_aEntries.Remove(pEntry);
delete pEntry;
return TRUE;
return true;
}
// ----------------------------------------------------------------------------
@@ -1764,7 +1764,7 @@ bool wxFileConfigGroup::DeleteEntry(const wxChar *szName)
// ----------------------------------------------------------------------------
void wxFileConfigGroup::SetDirty()
{
m_bDirty = TRUE;
m_bDirty = true;
if ( Parent() != NULL ) // propagate upwards
Parent()->SetDirty();
}
@@ -1788,7 +1788,7 @@ wxFileConfigEntry::wxFileConfigEntry(wxFileConfigGroup *pParent,
m_pLine = NULL;
m_bDirty =
m_bHasValue = FALSE;
m_bHasValue = false;
m_bImmutable = strName[0] == wxCONFIG_IMMUTABLE_PREFIX;
if ( m_bImmutable )
@@ -1810,7 +1810,7 @@ void wxFileConfigEntry::SetLine(wxFileConfigLineList *pLine)
Group()->SetLastEntry(this);
}
// second parameter is FALSE if we read the value from file and prevents the
// second parameter is false if we read the value from file and prevents the
// entry from being marked as 'dirty'
void wxFileConfigEntry::SetValue(const wxString& strValue, bool bUser)
{
@@ -1828,7 +1828,7 @@ void wxFileConfigEntry::SetValue(const wxString& strValue, bool bUser)
if ( m_bHasValue && strValue == m_strValue )
return;
m_bHasValue = TRUE;
m_bHasValue = true;
m_strValue = strValue;
if ( bUser )
@@ -1866,7 +1866,7 @@ void wxFileConfigEntry::SetValue(const wxString& strValue, bool bUser)
void wxFileConfigEntry::SetDirty()
{
m_bDirty = TRUE;
m_bDirty = true;
Group()->SetDirty();
}

View File

@@ -1024,11 +1024,11 @@ bool wxFileName::GetShortcutTarget(const wxString& shortcutPath, wxString& targe
HRESULT hres;
IShellLink* psl;
bool success = FALSE;
bool success = false;
// Assume it's not a shortcut if it doesn't end with lnk
if (ext.Lower() != wxT("lnk"))
return FALSE;
return false;
// create a ShellLink object
hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,

View File

@@ -105,15 +105,15 @@ wxString wxFileSystemHandler::GetMimeTypeFromExt(const wxString& location)
return mime;
#else
if ( ext.IsSameAs(wxT("htm"), FALSE) || ext.IsSameAs(_T("html"), FALSE) )
if ( ext.IsSameAs(wxT("htm"), false) || ext.IsSameAs(_T("html"), false) )
return wxT("text/html");
if ( ext.IsSameAs(wxT("jpg"), FALSE) || ext.IsSameAs(_T("jpeg"), FALSE) )
if ( ext.IsSameAs(wxT("jpg"), false) || ext.IsSameAs(_T("jpeg"), false) )
return wxT("image/jpeg");
if ( ext.IsSameAs(wxT("gif"), FALSE) )
if ( ext.IsSameAs(wxT("gif"), false) )
return wxT("image/gif");
if ( ext.IsSameAs(wxT("png"), FALSE) )
if ( ext.IsSameAs(wxT("png"), false) )
return wxT("image/png");
if ( ext.IsSameAs(wxT("bmp"), FALSE) )
if ( ext.IsSameAs(wxT("bmp"), false) )
return wxT("image/bmp");
return wxEmptyString;
#endif
@@ -125,11 +125,10 @@ wxString wxFileSystemHandler::GetProtocol(const wxString& location) const
{
wxString s = wxEmptyString;
int i, l = location.Length();
bool fnd;
bool fnd = false;
fnd = FALSE;
for (i = l-1; (i >= 0) && ((location[i] != wxT('#')) || (!fnd)); i--) {
if ((location[i] == wxT(':')) && (i != 1 /*win: C:\path*/)) fnd = TRUE;
if ((location[i] == wxT(':')) && (i != 1 /*win: C:\path*/)) fnd = true;
}
if (!fnd) return wxT("file");
for (++i; (i < l) && (location[i] != wxT(':')); i++) s << location[i];
@@ -140,11 +139,10 @@ wxString wxFileSystemHandler::GetProtocol(const wxString& location) const
wxString wxFileSystemHandler::GetLeftLocation(const wxString& location) const
{
int i;
bool fnd;
bool fnd = false;
fnd = FALSE;
for (i = location.Length()-1; i >= 0; i--) {
if ((location[i] == wxT(':')) && (i != 1 /*win: C:\path*/)) fnd = TRUE;
if ((location[i] == wxT(':')) && (i != 1 /*win: C:\path*/)) fnd = true;
else if (fnd && (location[i] == wxT('#'))) return location.Left(i);
}
return wxEmptyString;

View File

@@ -99,7 +99,7 @@ wxString wxFileDialogBase::AppendExtension(const wxString &filePath,
wxString fileName = filePath.AfterLast(wxFILE_SEP_PATH);
// if fileName is of form "foo.bar" it's ok, return it
int idx_dot = fileName.Find(wxT('.'), TRUE);
int idx_dot = fileName.Find(wxT('.'), true);
if ((idx_dot != wxNOT_FOUND) && (idx_dot < (int)fileName.Len() - 1))
return filePath;
@@ -107,7 +107,7 @@ wxString wxFileDialogBase::AppendExtension(const wxString &filePath,
wxString ext = extensionList.BeforeFirst(wxT(';'));
// if ext == "foo" or "foo." there's no extension
int idx_ext_dot = ext.Find(wxT('.'), TRUE);
int idx_ext_dot = ext.Find(wxT('.'), true);
if ((idx_ext_dot == wxNOT_FOUND) || (idx_ext_dot == (int)ext.Len() - 1))
return filePath;
else
@@ -277,7 +277,7 @@ WXDLLEXPORT wxString wxLoadFileSelector(const wxChar *what,
const wxChar *default_name,
wxWindow *parent)
{
return wxDefaultFileSelector(TRUE, what, extension, default_name, parent);
return wxDefaultFileSelector(true, what, extension, default_name, parent);
}
//----------------------------------------------------------------------------
@@ -289,7 +289,7 @@ WXDLLEXPORT wxString wxSaveFileSelector(const wxChar *what,
const wxChar *default_name,
wxWindow *parent)
{
return wxDefaultFileSelector(FALSE, what, extension, default_name, parent);
return wxDefaultFileSelector(false, what, extension, default_name, parent);
}
#endif // wxUSE_FILEDLG

View File

@@ -198,7 +198,7 @@ class wxFontMapperModule : public wxModule
{
public:
wxFontMapperModule() : wxModule() { }
virtual bool OnInit() { return TRUE; }
virtual bool OnInit() { return true; }
virtual void OnExit() { delete wxFontMapper::Set(NULL); }
DECLARE_DYNAMIC_CLASS(wxFontMapperModule)
@@ -221,7 +221,7 @@ wxFontMapperBase::wxFontMapperBase()
{
#if wxUSE_CONFIG && wxUSE_FILECONFIG
m_config = NULL;
m_configIsDummy = FALSE;
m_configIsDummy = false;
#endif // wxUSE_CONFIG
}
@@ -295,7 +295,7 @@ wxConfigBase *wxFontMapperBase::GetConfig()
if ( !m_config )
{
// try the default
m_config = wxConfig::Get(FALSE /*don't create on demand*/ );
m_config = wxConfig::Get(false /*don't create on demand*/ );
if ( !m_config )
{
@@ -305,7 +305,7 @@ wxConfigBase *wxFontMapperBase::GetConfig()
// but will allow us to remember the results of the questions at
// least during this run
m_config = new wxMemoryConfig;
m_configIsDummy = TRUE;
m_configIsDummy = true;
// VS: we can't call wxConfig::Set(m_config) here because that would
// disable automatic wxConfig instance creation if this code was
// called before wxApp::OnInit (this happens in wxGTK -- it sets
@@ -313,13 +313,13 @@ wxConfigBase *wxFontMapperBase::GetConfig()
}
}
if ( m_configIsDummy && wxConfig::Get(FALSE) != NULL )
if ( m_configIsDummy && wxConfig::Get(false) != NULL )
{
// VS: in case we created dummy m_config (see above), we want to switch back
// to the real one as soon as one becomes available.
delete m_config;
m_config = wxConfig::Get(FALSE);
m_configIsDummy = FALSE;
m_config = wxConfig::Get(false);
m_configIsDummy = false;
// FIXME: ideally, we should add keys from dummy config to the real one now,
// but it is a low-priority task because typical wxWin application
// either doesn't use wxConfig at all or creates wxConfig object in
@@ -349,7 +349,7 @@ bool wxFontMapperBase::ChangePath(const wxString& pathNew, wxString *pathOld)
{
wxConfigBase *config = GetConfig();
if ( !config )
return FALSE;
return false;
*pathOld = config->GetPath();
@@ -366,7 +366,7 @@ bool wxFontMapperBase::ChangePath(const wxString& pathNew, wxString *pathOld)
config->SetPath(path);
return TRUE;
return true;
}
void wxFontMapperBase::RestorePath(const wxString& pathOld)
@@ -437,7 +437,7 @@ wxFontMapperBase::NonInteractiveCharsetToEncoding(const wxString& charset)
config->SetPath(FONTMAPPER_CHARSET_ALIAS_PATH);
wxString alias = config->Read(charset);
if ( !!alias )
if ( !alias.IsEmpty() )
{
// yes, we do - use it instead
cs = alias;

View File

@@ -284,42 +284,42 @@ bool wxNativeFontInfo::FromString(const wxString& s)
token = tokenizer.GetNextToken();
if ( !token.ToLong(&l) )
return FALSE;
return false;
pointSize = (int)l;
token = tokenizer.GetNextToken();
if ( !token.ToLong(&l) )
return FALSE;
return false;
family = (wxFontFamily)l;
token = tokenizer.GetNextToken();
if ( !token.ToLong(&l) )
return FALSE;
return false;
style = (wxFontStyle)l;
token = tokenizer.GetNextToken();
if ( !token.ToLong(&l) )
return FALSE;
return false;
weight = (wxFontWeight)l;
token = tokenizer.GetNextToken();
if ( !token.ToLong(&l) )
return FALSE;
return false;
underlined = l != 0;
faceName = tokenizer.GetNextToken();
#ifndef __WXMAC__
if( !faceName )
return FALSE;
return false;
#endif
token = tokenizer.GetNextToken();
if ( !token.ToLong(&l) )
return FALSE;
return false;
encoding = (wxFontEncoding)l;
return TRUE;
return true;
}
wxString wxNativeFontInfo::ToString() const
@@ -345,7 +345,7 @@ void wxNativeFontInfo::Init()
family = wxFONTFAMILY_DEFAULT;
style = wxFONTSTYLE_NORMAL;
weight = wxFONTWEIGHT_NORMAL;
underlined = FALSE;
underlined = false;
faceName.clear();
encoding = wxFONTENCODING_DEFAULT;
}
@@ -519,12 +519,12 @@ bool wxNativeFontInfo::FromUserString(const wxString& s)
wxString token = tokenizer.GetNextToken();
// normalize it
token.Trim(TRUE).Trim(FALSE).MakeLower();
token.Trim(true).Trim(false).MakeLower();
// look for the known tokens
if ( token == _T("underlined") || token == _("underlined") )
{
SetUnderlined(TRUE);
SetUnderlined(true);
}
else if ( token == _T("light") || token == _("light") )
{
@@ -543,7 +543,7 @@ bool wxNativeFontInfo::FromUserString(const wxString& s)
SetPointSize(size);
}
#if wxUSE_FONTMAP
else if ( (encoding = wxFontMapper::Get()->CharsetToEncoding(token, FALSE))
else if ( (encoding = wxFontMapper::Get()->CharsetToEncoding(token, false))
!= wxFONTENCODING_DEFAULT )
{
SetEncoding(encoding);
@@ -578,7 +578,7 @@ bool wxNativeFontInfo::FromUserString(const wxString& s)
SetFaceName(face);
}
return TRUE;
return true;
}
#endif // generic or wxMSW or wxOS2

View File

@@ -316,7 +316,7 @@ bool wxFontMapper::GetAltForEncoding(wxFontEncoding encoding,
wxString configEntry,
encName = GetEncodingName(encoding);
if ( !!facename )
if ( !facename.IsEmpty() )
{
configEntry = facename + _T("_");
}
@@ -340,13 +340,13 @@ bool wxFontMapper::GetAltForEncoding(wxFontEncoding encoding,
}
else // use the info entered the last time
{
if ( !!fontinfo && !!facename )
if ( !fontinfo.IsEmpty() && !facename.IsEmpty() )
{
// we tried to find a match with facename -- now try without it
fontinfo = GetConfig()->Read(encName);
}
if ( !!fontinfo )
if ( !fontinfo.IsEmpty() )
{
if ( info->FromString(fontinfo) )
{

View File

@@ -91,7 +91,7 @@ bool wxInternetFSHandler::CanOpen(const wxString& location)
return (url.GetError() == wxURL_NOERR);
}
return FALSE;
return false;
}
@@ -141,7 +141,7 @@ class wxFileSystemInternetModule : public wxModule
virtual bool OnInit()
{
wxFileSystem::AddHandler(new wxInternetFSHandler);
return TRUE;
return true;
}
virtual void OnExit() {}
};

View File

@@ -175,10 +175,10 @@ bool wxMemoryFSHandlerBase::CheckHash(const wxString& filename)
wxString s;
s.Printf(_("Memory VFS already contains file '%s'!"), filename.c_str());
wxLogError(s);
return FALSE;
return false;
}
else
return TRUE;
return true;
}

View File

@@ -47,7 +47,7 @@ wxZipFSHandler::wxZipFSHandler() : wxFileSystemHandler()
{
m_Archive = NULL;
m_ZipFile = m_Pattern = m_BaseDir = wxEmptyString;
m_AllowDirs = m_AllowFiles = TRUE;
m_AllowDirs = m_AllowFiles = true;
m_DirsFound = NULL;
}
@@ -138,11 +138,11 @@ wxString wxZipFSHandler::FindFirst(const wxString& spec, int flags)
switch (flags)
{
case wxFILE:
m_AllowDirs = FALSE, m_AllowFiles = TRUE; break;
m_AllowDirs = false, m_AllowFiles = true; break;
case wxDIR:
m_AllowDirs = TRUE, m_AllowFiles = FALSE; break;
m_AllowDirs = true, m_AllowFiles = false; break;
default:
m_AllowDirs = m_AllowFiles = TRUE; break;
m_AllowDirs = m_AllowFiles = true; break;
}
m_ZipFile = left;
@@ -208,7 +208,7 @@ wxString wxZipFSHandler::DoFind()
filename = dir.AfterLast(wxT('/'));
dir = dir.BeforeLast(wxT('/'));
if (!filename.IsEmpty() && m_BaseDir == dir &&
wxMatchWild(m_Pattern, filename, FALSE))
wxMatchWild(m_Pattern, filename, false))
match = m_ZipFile + wxT("#zip:") + dir + wxT("/") + filename;
}
else
@@ -219,7 +219,7 @@ wxString wxZipFSHandler::DoFind()
filename = namestr.AfterLast(wxT('/'));
dir = namestr.BeforeLast(wxT('/'));
if (m_AllowFiles && !filename.IsEmpty() && m_BaseDir == dir &&
wxMatchWild(m_Pattern, filename, FALSE))
wxMatchWild(m_Pattern, filename, false))
match = m_ZipFile + wxT("#zip:") + namestr;
if (unzGoToNextFile((unzFile)m_Archive) != UNZ_OK)

View File

@@ -69,7 +69,7 @@ static const size_t LEN_CODE = 3;
// ----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxFTP, wxProtocol)
IMPLEMENT_PROTOCOL(wxFTP, wxT("ftp"), wxT("ftp"), TRUE)
IMPLEMENT_PROTOCOL(wxFTP, wxT("ftp"), wxT("ftp"), true)
// ============================================================================
// implementation
@@ -82,7 +82,7 @@ IMPLEMENT_PROTOCOL(wxFTP, wxT("ftp"), wxT("ftp"), TRUE)
wxFTP::wxFTP()
{
m_lastError = wxPROTO_NOERR;
m_streaming = FALSE;
m_streaming = false;
m_currentTransfermode = NONE;
m_user = wxT("anonymous");
@@ -111,20 +111,20 @@ bool wxFTP::Connect(wxSockAddress& addr, bool WXUNUSED(wait))
if ( !wxProtocol::Connect(addr) )
{
m_lastError = wxPROTO_NETERR;
return FALSE;
return false;
}
if ( !m_user )
{
m_lastError = wxPROTO_CONNERR;
return FALSE;
return false;
}
// we should have 220 welcome message
if ( !CheckResult('2') )
{
Close();
return FALSE;
return false;
}
wxString command;
@@ -133,23 +133,23 @@ bool wxFTP::Connect(wxSockAddress& addr, bool WXUNUSED(wait))
if ( rc == '2' )
{
// 230 return: user accepted without password
return TRUE;
return true;
}
if ( rc != '3' )
{
Close();
return FALSE;
return false;
}
command.Printf(wxT("PASS %s"), m_passwd.c_str());
if ( !CheckCommand(command, '2') )
{
Close();
return FALSE;
return false;
}
return TRUE;
return true;
}
bool wxFTP::Connect(const wxString& host)
@@ -166,7 +166,7 @@ bool wxFTP::Close()
if ( m_streaming )
{
m_lastError = wxPROTO_STREAMING;
return FALSE;
return false;
}
if ( IsConnected() )
@@ -241,9 +241,9 @@ char wxFTP::GetResult()
// ...
// xyz ...
// and the intermeidate lines may start with xyz or not
bool badReply = FALSE;
bool firstLine = TRUE;
bool endOfReply = FALSE;
bool badReply = false;
bool firstLine = true;
bool endOfReply = false;
while ( !endOfReply && !badReply )
{
wxString line;
@@ -265,7 +265,7 @@ char wxFTP::GetResult()
{
if ( firstLine )
{
badReply = TRUE;
badReply = true;
}
else
{
@@ -287,16 +287,16 @@ char wxFTP::GetResult()
switch ( chMarker )
{
case _T(' '):
endOfReply = TRUE;
endOfReply = true;
break;
case _T('-'):
firstLine = FALSE;
firstLine = false;
break;
default:
// unexpected
badReply = TRUE;
badReply = true;
}
}
else // subsequent line of multiline reply
@@ -305,7 +305,7 @@ char wxFTP::GetResult()
{
if ( chMarker == _T(' ') )
{
endOfReply = TRUE;
endOfReply = true;
}
wxLogTrace(FTP_TRACE_MASK, _T("<== %s %s"),
@@ -344,7 +344,7 @@ bool wxFTP::SetTransferMode(TransferMode transferMode)
if ( transferMode == m_currentTransfermode )
{
// nothing to do
return TRUE;
return true;
}
wxString mode;
@@ -368,14 +368,14 @@ bool wxFTP::SetTransferMode(TransferMode transferMode)
wxLogError(_("Failed to set FTP transfer mode to %s."), (const wxChar*)
(transferMode == ASCII ? _("ASCII") : _("binary")));
return FALSE;
return false;
}
// If we get here the operation has been succesfully completed
// Set the status-member
m_currentTransfermode = transferMode;
return TRUE;
return true;
}
bool wxFTP::DoSimpleCommand(const wxChar *command, const wxString& arg)
@@ -390,10 +390,10 @@ bool wxFTP::DoSimpleCommand(const wxChar *command, const wxString& arg)
{
wxLogDebug(_T("FTP command '%s' failed."), fullcmd.c_str());
return FALSE;
return false;
}
return TRUE;
return true;
}
bool wxFTP::ChDir(const wxString& dir)
@@ -468,7 +468,7 @@ bool wxFTP::Rename(const wxString& src, const wxString& dst)
str = wxT("RNFR ") + src;
if ( !CheckCommand(str, '3') )
return FALSE;
return false;
str = wxT("RNTO ") + dst;
@@ -512,7 +512,7 @@ public:
// wait for "226 transfer completed"
m_ftp->CheckResult('2');
m_ftp->m_streaming = FALSE;
m_ftp->m_streaming = false;
}
else
{
@@ -547,7 +547,7 @@ public:
// read this reply
m_ftp->CheckResult('2');
m_ftp->m_streaming = FALSE;
m_ftp->m_streaming = false;
}
else
{
@@ -613,7 +613,7 @@ wxSocketClient *wxFTP::GetPort()
return NULL;
}
client->Notify(FALSE);
client->Notify(false);
return client;
}
@@ -621,11 +621,11 @@ wxSocketClient *wxFTP::GetPort()
bool wxFTP::Abort()
{
if ( !m_streaming )
return TRUE;
return true;
m_streaming = FALSE;
m_streaming = false;
if ( !CheckCommand(wxT("ABOR"), '4') )
return FALSE;
return false;
return CheckResult('2');
}
@@ -650,7 +650,7 @@ wxInputStream *wxFTP::GetInputStream(const wxString& path)
if ( !CheckCommand(tmp_str, '1') )
return NULL;
m_streaming = TRUE;
m_streaming = true;
in_stream = new wxInputFTPStream(this, sock);
@@ -678,7 +678,7 @@ wxOutputStream *wxFTP::GetOutputStream(const wxString& path)
if ( !CheckCommand(tmp_str, '1') )
return NULL;
m_streaming = TRUE;
m_streaming = true;
return new wxOutputFTPStream(this, sock);
}
@@ -693,7 +693,7 @@ bool wxFTP::GetList(wxArrayString& files,
{
wxSocketBase *sock = GetPort();
if (!sock)
return FALSE;
return false;
// NLST : List of Filenames (including Directory's !)
// LIST : depending on BS of FTP-Server
@@ -701,14 +701,14 @@ bool wxFTP::GetList(wxArrayString& files,
// - Windows : like "dir" command
// - others : ?
wxString line(details ? _T("LIST") : _T("NLST"));
if ( !!wildcard )
if ( !wildcard.IsEmpty() )
{
line << _T(' ') << wildcard;
}
if (!CheckCommand(line, '1'))
{
return FALSE;
return false;
}
files.Empty();
while ( ReadLine(sock, line) == wxPROTO_NOERR )
@@ -719,9 +719,9 @@ bool wxFTP::GetList(wxArrayString& files,
// the file list should be terminated by "226 Transfer complete""
if ( !CheckResult('2') )
return FALSE;
return false;
return TRUE;
return true;
}
bool wxFTP::FileExists(const wxString& fileName)
@@ -730,10 +730,10 @@ bool wxFTP::FileExists(const wxString& fileName)
// current dir. It does so by simply doing an NLST (via GetList).
// If this succeeds (and the list is not empty) the file exists.
bool retval = FALSE;
bool retval = false;
wxArrayString fileList;
if ( GetList(fileList, fileName, FALSE) )
if ( GetList(fileList, fileName, false) )
{
// Some ftp-servers (Ipswitch WS_FTP Server 1.0.5 does this)
// displays this behaviour when queried on a non-existing file:
@@ -787,13 +787,13 @@ int wxFTP::GetFileSize(const wxString& fileName)
&statuscode, &filesize) == 2 )
{
// We've gotten a good reply.
ok = TRUE;
ok = true;
}
else
{
// Something bad happened.. A "2yz" reply with no size
// Fallback
ok = FALSE;
ok = false;
}
}
@@ -813,7 +813,7 @@ int wxFTP::GetFileSize(const wxString& fileName)
// We now try to get details for the file with a "LIST"-command
// and then parse the output from there..
wxArrayString fileList;
if ( GetList(fileList, fileName, TRUE) )
if ( GetList(fileList, fileName, true) )
{
if ( !fileList.IsEmpty() )
{
@@ -822,7 +822,7 @@ int wxFTP::GetFileSize(const wxString& fileName)
// substring containing the name we are looking for. We
// stop the iteration at the first occurrence of the
// filename. The search is not case-sensitive.
bool foundIt = FALSE;
bool foundIt = false;
size_t i;
for ( i = 0; !foundIt && i < fileList.Count(); i++ )