Source cleaning: whitespaces, tabs, -1/wxID_ANY/wxNOT_FOUND/wxDefaultCoord, TRUE/true, FALSE/false.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29257 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -107,7 +107,7 @@ public:
|
||||
|
||||
virtual int Type() { return wxSockAddress::IPV4; }
|
||||
virtual wxSockAddress *Clone() const;
|
||||
|
||||
|
||||
bool operator==(wxIPV4address& addr);
|
||||
|
||||
private:
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
// IPV6 name formats
|
||||
//
|
||||
// hostname
|
||||
// 3ffe:ffff:0100:f101:0210:a4ff:fee3:9566
|
||||
// 3ffe:ffff:0100:f101:0210:a4ff:fee3:9566
|
||||
// compact (base85) Itu&-ZQ82s>J%s99FJXT
|
||||
// compressed format ::1
|
||||
// ipv4 mapped ::ffff:1.2.3.4
|
||||
@@ -148,7 +148,7 @@ public:
|
||||
// any (0000:0000:0000:0000:0000:0000:0000:0000 (::))
|
||||
virtual bool AnyAddress();
|
||||
|
||||
// 3ffe:ffff:0100:f101:0210:a4ff:fee3:9566
|
||||
// 3ffe:ffff:0100:f101:0210:a4ff:fee3:9566
|
||||
virtual wxString IPAddress() const;
|
||||
|
||||
virtual wxString Hostname() const;
|
||||
|
@@ -79,8 +79,8 @@ public:
|
||||
virtual bool Disconnect(void);
|
||||
|
||||
// Callbacks to BOTH - override at will
|
||||
// Default behaviour is to delete connection and return TRUE
|
||||
virtual bool OnDisconnect(void) { delete this; return TRUE; }
|
||||
// Default behaviour is to delete connection and return true
|
||||
virtual bool OnDisconnect(void) { delete this; return true; }
|
||||
|
||||
// To enable the compressor (NOTE: not implemented!)
|
||||
void Compress(bool on);
|
||||
@@ -116,7 +116,7 @@ public:
|
||||
wxTCPServer();
|
||||
virtual ~wxTCPServer();
|
||||
|
||||
// Returns FALSE on error (e.g. port number is already in use)
|
||||
// Returns false on error (e.g. port number is already in use)
|
||||
virtual bool Create(const wxString& serverName);
|
||||
|
||||
// Callbacks to SERVER - override at will
|
||||
|
@@ -32,7 +32,7 @@ namespace wxPrivate
|
||||
// ScopeGuardImplBase but gcc 2.8 which is still used for OS/2 doesn't
|
||||
// support member templates and so we must make it global
|
||||
template <typename ScopeGuardImpl>
|
||||
void OnScopeExit(ScopeGuardImpl& guard)
|
||||
void OnScopeExit(ScopeGuardImpl& guard)
|
||||
{
|
||||
if ( !guard.WasDismissed() )
|
||||
{
|
||||
@@ -51,7 +51,7 @@ namespace wxPrivate
|
||||
{
|
||||
}
|
||||
} // namespace wxPrivate
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// wxScopeGuard for functions and functors
|
||||
// ============================================================================
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
protected:
|
||||
~wxScopeGuardImplBase() { }
|
||||
|
||||
wxScopeGuardImplBase(const wxScopeGuardImplBase& other)
|
||||
wxScopeGuardImplBase(const wxScopeGuardImplBase& other)
|
||||
: m_wasDismissed(other.m_wasDismissed)
|
||||
{
|
||||
other.Dismiss();
|
||||
@@ -111,7 +111,7 @@ protected:
|
||||
wxScopeGuardImpl0& operator=(const wxScopeGuardImpl0&);
|
||||
};
|
||||
|
||||
template <typename F>
|
||||
template <typename F>
|
||||
inline wxScopeGuardImpl0<F> wxMakeGuard(F fun)
|
||||
{
|
||||
return wxScopeGuardImpl0<F>::MakeGuard(fun);
|
||||
@@ -143,7 +143,7 @@ protected:
|
||||
wxScopeGuardImpl1& operator=(const wxScopeGuardImpl1&);
|
||||
};
|
||||
|
||||
template <typename F, typename P1>
|
||||
template <typename F, typename P1>
|
||||
inline wxScopeGuardImpl1<F, P1> wxMakeGuard(F fun, P1 p1)
|
||||
{
|
||||
return wxScopeGuardImpl1<F, P1>::MakeGuard(fun, p1);
|
||||
@@ -233,7 +233,7 @@ public:
|
||||
void Execute() { (m_obj.*m_memfun)(m_p1); }
|
||||
|
||||
protected:
|
||||
wxObjScopeGuardImpl1(Obj& obj, MemFun memFun, P1 p1)
|
||||
wxObjScopeGuardImpl1(Obj& obj, MemFun memFun, P1 p1)
|
||||
: m_obj(obj), m_memfun(memFun), m_p1(p1) { }
|
||||
|
||||
Obj& m_obj;
|
||||
@@ -263,7 +263,7 @@ public:
|
||||
void Execute() { (m_obj.*m_memfun)(m_p1, m_p2); }
|
||||
|
||||
protected:
|
||||
wxObjScopeGuardImpl2(Obj& obj, MemFun memFun, P1 p1, P2 p2)
|
||||
wxObjScopeGuardImpl2(Obj& obj, MemFun memFun, P1 p1, P2 p2)
|
||||
: m_obj(obj), m_memfun(memFun), m_p1(p1), m_p2(p2) { }
|
||||
|
||||
Obj& m_obj;
|
||||
|
@@ -37,7 +37,7 @@ public:
|
||||
virtual void SetThumbPosition(int viewStart) = 0;
|
||||
virtual void SetScrollbar(int position, int thumbSize,
|
||||
int range, int pageSize,
|
||||
bool refresh = TRUE) = 0;
|
||||
bool refresh = true) = 0;
|
||||
|
||||
private:
|
||||
DECLARE_NO_COPY_CLASS(wxScrollBarBase)
|
||||
|
@@ -35,7 +35,7 @@ public:
|
||||
virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
|
||||
int noUnitsX, int noUnitsY,
|
||||
int xPos = 0, int yPos = 0,
|
||||
bool noRefresh = FALSE );
|
||||
bool noRefresh = false );
|
||||
|
||||
// scroll to the given (in logical coords) position
|
||||
virtual void Scroll(int x, int y);
|
||||
@@ -51,9 +51,9 @@ public:
|
||||
virtual void GetScrollPixelsPerUnit(int *pixelsPerUnitX,
|
||||
int *pixelsPerUnitY) const;
|
||||
|
||||
// Enable/disable Windows scrolling in either direction. If TRUE, wxWidgets
|
||||
// Enable/disable Windows scrolling in either direction. If true, wxWidgets
|
||||
// scrolls the canvas and only a bit of the canvas is invalidated; no
|
||||
// Clear() is necessary. If FALSE, the whole canvas is invalidated and a
|
||||
// Clear() is necessary. If false, the whole canvas is invalidated and a
|
||||
// Clear() is necessary. Disable for when the scroll increment is used to
|
||||
// actually scroll a non-constant distance
|
||||
virtual void EnableScrolling(bool x_scrolling, bool y_scrolling);
|
||||
@@ -121,7 +121,7 @@ public:
|
||||
// stop the timer, so it will be called repeatedly and will typically
|
||||
// return different values depending on the current mouse position
|
||||
//
|
||||
// the base class version just returns TRUE
|
||||
// the base class version just returns true
|
||||
virtual bool SendAutoScrollEvents(wxScrollWinEvent& event) const;
|
||||
|
||||
// the methods to be called from the window event handlers
|
||||
@@ -219,7 +219,7 @@ protected:
|
||||
public:
|
||||
wxScrolledWindow() { }
|
||||
wxScrolledWindow(wxWindow *parent,
|
||||
wxWindowID winid = -1,
|
||||
wxWindowID winid = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxScrolledWindowStyle,
|
||||
|
@@ -48,7 +48,7 @@ public:
|
||||
void SetItemCount(size_t count) { m_count = count; }
|
||||
|
||||
// special case of SetItemCount(0)
|
||||
void Clear() { m_itemsSel.Clear(); m_count = 0; m_defaultState = FALSE; }
|
||||
void Clear() { m_itemsSel.Clear(); m_count = 0; m_defaultState = false; }
|
||||
|
||||
// must be called when a new item is inserted/added
|
||||
void OnItemAdd(size_t WXUNUSED(item)) { wxFAIL_MSG( _T("TODO") ); }
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
// select one item, use SelectRange() insted if possible!
|
||||
//
|
||||
// returns true if the items selection really changed
|
||||
bool SelectItem(size_t item, bool select = TRUE);
|
||||
bool SelectItem(size_t item, bool select = true);
|
||||
|
||||
// select the range of items
|
||||
//
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
// (meaning that too many items changed state to bother counting them
|
||||
// individually)
|
||||
bool SelectRange(size_t itemFrom, size_t itemTo,
|
||||
bool select = TRUE,
|
||||
bool select = true,
|
||||
wxArrayInt *itemsChanged = NULL);
|
||||
|
||||
// return true if the given item is selected
|
||||
@@ -83,12 +83,12 @@ public:
|
||||
|
||||
private:
|
||||
// (re)init
|
||||
void Init() { m_defaultState = FALSE; }
|
||||
void Init() { m_defaultState = false; }
|
||||
|
||||
// the total number of items we handle
|
||||
size_t m_count;
|
||||
|
||||
// the default state: normally, FALSE (i.e. off) but maybe set to TRUE if
|
||||
// the default state: normally, false (i.e. off) but maybe set to true if
|
||||
// there are more selected items than non selected ones - this allows to
|
||||
// handle selection of all items efficiently
|
||||
bool m_defaultState;
|
||||
|
@@ -44,7 +44,7 @@ public:
|
||||
// path is optional and is ignored under Win32 and used as the directory to
|
||||
// create the lock file in under Unix (default is wxGetHomeDir())
|
||||
//
|
||||
// returns FALSE if initialization failed, it doesn't mean that another
|
||||
// returns false if initialization failed, it doesn't mean that another
|
||||
// instance is running - use IsAnotherRunning() to check it
|
||||
bool Create(const wxString& name, const wxString& path = wxEmptyString);
|
||||
|
||||
|
@@ -136,7 +136,7 @@ public:
|
||||
wxSocketBase& Write(const void *buffer, wxUint32 nbytes);
|
||||
wxSocketBase& WriteMsg(const void *buffer, wxUint32 nbytes);
|
||||
|
||||
void InterruptWait() { m_interrupt = TRUE; };
|
||||
void InterruptWait() { m_interrupt = true; };
|
||||
bool Wait(long seconds = -1, long milliseconds = 0);
|
||||
bool WaitForRead(long seconds = -1, long milliseconds = 0);
|
||||
bool WaitForWrite(long seconds = -1, long milliseconds = 0);
|
||||
@@ -153,7 +153,7 @@ public:
|
||||
// event handling
|
||||
void *GetClientData() const { return m_clientData; }
|
||||
void SetClientData(void *data) { m_clientData = data; }
|
||||
void SetEventHandler(wxEvtHandler& handler, int id = -1);
|
||||
void SetEventHandler(wxEvtHandler& handler, int id = wxID_ANY);
|
||||
void SetNotify(wxSocketEventFlags flags);
|
||||
void Notify(bool notify);
|
||||
|
||||
@@ -236,8 +236,8 @@ class WXDLLIMPEXP_NET wxSocketServer : public wxSocketBase
|
||||
public:
|
||||
wxSocketServer(wxSockAddress& addr, wxSocketFlags flags = wxSOCKET_NONE);
|
||||
|
||||
wxSocketBase* Accept(bool wait = TRUE);
|
||||
bool AcceptWith(wxSocketBase& socket, bool wait = TRUE);
|
||||
wxSocketBase* Accept(bool wait = true);
|
||||
bool AcceptWith(wxSocketBase& socket, bool wait = true);
|
||||
|
||||
bool WaitForAccept(long seconds = -1, long milliseconds = 0);
|
||||
|
||||
@@ -257,7 +257,7 @@ public:
|
||||
wxSocketClient(wxSocketFlags flags = wxSOCKET_NONE);
|
||||
virtual ~wxSocketClient();
|
||||
|
||||
virtual bool Connect(wxSockAddress& addr, bool wait = TRUE);
|
||||
virtual bool Connect(wxSockAddress& addr, bool wait = true);
|
||||
|
||||
bool WaitOnConnect(long seconds = -1, long milliseconds = 0);
|
||||
|
||||
@@ -321,7 +321,7 @@ public:
|
||||
typedef void (wxEvtHandler::*wxSocketEventFunction)(wxSocketEvent&);
|
||||
|
||||
#define EVT_SOCKET(id, func) \
|
||||
DECLARE_EVENT_TABLE_ENTRY( wxEVT_SOCKET, id, -1, \
|
||||
DECLARE_EVENT_TABLE_ENTRY( wxEVT_SOCKET, id, wxID_ANY, \
|
||||
(wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSocketEventFunction, & func ), \
|
||||
(wxObject *) NULL ),
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
// Created: 2004/02/01
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2004, Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_SOUND_H_BASE_
|
||||
@@ -27,7 +27,7 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Flags for wxSound::Play
|
||||
|
||||
|
||||
// NB: We can't use enum because there would be ambiguity between the
|
||||
// two Play() prototypes when called without explicit parameters
|
||||
// if WXWIN_COMPATIBILITY_2_4.
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
|
||||
// Plays sound from filename:
|
||||
static bool Play(const wxString& filename, unsigned flags = wxSOUND_ASYNC);
|
||||
|
||||
|
||||
protected:
|
||||
virtual bool DoPlay(unsigned flags) const = 0;
|
||||
};
|
||||
|
@@ -112,11 +112,11 @@ typedef void (wxEvtHandler::*wxSpinEventFunction)(wxSpinEvent&);
|
||||
|
||||
// macros for handling spin events
|
||||
#define EVT_SPIN_UP(winid, func) \
|
||||
DECLARE_EVENT_TABLE_ENTRY( wxEVT_SCROLL_LINEUP, winid, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSpinEventFunction, & func ), NULL ),
|
||||
DECLARE_EVENT_TABLE_ENTRY( wxEVT_SCROLL_LINEUP, winid, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSpinEventFunction, & func ), NULL ),
|
||||
#define EVT_SPIN_DOWN(winid, func) \
|
||||
DECLARE_EVENT_TABLE_ENTRY( wxEVT_SCROLL_LINEDOWN, winid, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSpinEventFunction, & func ), NULL ),
|
||||
DECLARE_EVENT_TABLE_ENTRY( wxEVT_SCROLL_LINEDOWN, winid, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSpinEventFunction, & func ), NULL ),
|
||||
#define EVT_SPIN(winid, func) \
|
||||
DECLARE_EVENT_TABLE_ENTRY( wxEVT_SCROLL_THUMBTRACK, winid, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSpinEventFunction, & func ), NULL ),
|
||||
DECLARE_EVENT_TABLE_ENTRY( wxEVT_SCROLL_THUMBTRACK, winid, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSpinEventFunction, & func ), NULL ),
|
||||
|
||||
#endif // wxUSE_SPINBTN
|
||||
|
||||
|
@@ -70,7 +70,7 @@ protected:
|
||||
#endif // platform
|
||||
|
||||
#define EVT_SPINCTRL(id, fn) \
|
||||
DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_SPINCTRL_UPDATED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSpinEventFunction, & fn ), (wxObject *) NULL ),
|
||||
DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_SPINCTRL_UPDATED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSpinEventFunction, & fn ), (wxObject *) NULL ),
|
||||
|
||||
#endif // _WX_SPINCTRL_H_
|
||||
|
||||
|
@@ -16,28 +16,28 @@
|
||||
#define WX_DECLARE_STACK(obj, cls)\
|
||||
class cls : public wxVectorBase\
|
||||
{\
|
||||
WX_DECLARE_VECTORBASE(obj, cls);\
|
||||
WX_DECLARE_VECTORBASE(obj, cls);\
|
||||
public:\
|
||||
void push(const obj& o)\
|
||||
{\
|
||||
bool rc = Alloc(size() + 1);\
|
||||
wxASSERT(rc);\
|
||||
Append(new obj(o));\
|
||||
};\
|
||||
void push(const obj& o)\
|
||||
{\
|
||||
bool rc = Alloc(size() + 1);\
|
||||
wxASSERT(rc);\
|
||||
Append(new obj(o));\
|
||||
};\
|
||||
\
|
||||
void pop()\
|
||||
{\
|
||||
RemoveAt(size() - 1);\
|
||||
};\
|
||||
void pop()\
|
||||
{\
|
||||
RemoveAt(size() - 1);\
|
||||
};\
|
||||
\
|
||||
obj& top()\
|
||||
{\
|
||||
return *(obj *) GetItem(size() - 1);\
|
||||
};\
|
||||
const obj& top() const\
|
||||
{\
|
||||
return *(obj *) GetItem(size() - 1);\
|
||||
};\
|
||||
obj& top()\
|
||||
{\
|
||||
return *(obj *) GetItem(size() - 1);\
|
||||
};\
|
||||
const obj& top() const\
|
||||
{\
|
||||
return *(obj *) GetItem(size() - 1);\
|
||||
};\
|
||||
}
|
||||
|
||||
#endif // _WX_STACK_H_
|
||||
|
@@ -34,14 +34,14 @@ class WXDLLEXPORT wxStaticBitmapBase : public wxControl
|
||||
public:
|
||||
wxStaticBitmapBase() { }
|
||||
virtual ~wxStaticBitmapBase();
|
||||
|
||||
|
||||
// our interface
|
||||
virtual void SetIcon(const wxIcon& icon) = 0;
|
||||
virtual void SetBitmap(const wxBitmap& bitmap) = 0;
|
||||
virtual wxBitmap GetBitmap() const = 0;
|
||||
|
||||
// overriden base class virtuals
|
||||
virtual bool AcceptsFocus() const { return FALSE; }
|
||||
virtual bool AcceptsFocus() const { return false; }
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
@@ -58,12 +58,12 @@ protected:
|
||||
wxSize sizeReal(size);
|
||||
if ( IsVertical() )
|
||||
{
|
||||
if ( size.x == -1 )
|
||||
if ( size.x == wxDefaultCoord )
|
||||
sizeReal.x = GetDefaultSize();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( size.y == -1 )
|
||||
if ( size.y == wxDefaultCoord )
|
||||
sizeReal.y = GetDefaultSize();
|
||||
}
|
||||
|
||||
|
@@ -76,8 +76,8 @@ public:
|
||||
// field styles
|
||||
// ------------
|
||||
|
||||
// Set the field style. Use either wxSB_NORMAL (default) for a standard 3D
|
||||
// border around a field, wxSB_FLAT for no border around a field, so that it
|
||||
// Set the field style. Use either wxSB_NORMAL (default) for a standard 3D
|
||||
// border around a field, wxSB_FLAT for no border around a field, so that it
|
||||
// appears flat or wxSB_POPOUT to make the field appear raised.
|
||||
// Setting field styles only works on wxMSW
|
||||
virtual void SetStatusStyles(int n, const int styles[]);
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
virtual int GetBorderY() const = 0;
|
||||
|
||||
// don't want status bars to accept the focus at all
|
||||
virtual bool AcceptsFocus() const { return FALSE; }
|
||||
virtual bool AcceptsFocus() const { return false; }
|
||||
|
||||
protected:
|
||||
// set the widths array to NULL
|
||||
@@ -132,7 +132,7 @@ protected:
|
||||
// width otherwise
|
||||
int *m_statusWidths;
|
||||
|
||||
// the styles of the fields
|
||||
// the styles of the fields
|
||||
int *m_statusStyles;
|
||||
|
||||
// stacks of previous values for PushStatusText/PopStatusText
|
||||
|
@@ -73,7 +73,7 @@ void WXDLLIMPEXP_BASE wxStartTimer();
|
||||
|
||||
// Gets elapsed milliseconds since last wxStartTimer or wxGetElapsedTime
|
||||
// -- DEPRECATED: use wxStopWatch instead
|
||||
long WXDLLIMPEXP_BASE wxGetElapsedTime(bool resetTimer = TRUE);
|
||||
long WXDLLIMPEXP_BASE wxGetElapsedTime(bool resetTimer = true);
|
||||
|
||||
#endif // wxUSE_LONGLONG
|
||||
|
||||
|
@@ -159,7 +159,7 @@ public:
|
||||
// all the requested data or not
|
||||
virtual size_t LastRead() const { return wxStreamBase::m_lastcount; }
|
||||
|
||||
// returns TRUE if some data is available in the stream right now, so that
|
||||
// returns true if some data is available in the stream right now, so that
|
||||
// calling Read() wouldn't block
|
||||
virtual bool CanRead() const;
|
||||
|
||||
@@ -181,7 +181,7 @@ public:
|
||||
|
||||
// put back the specified character in the stream
|
||||
//
|
||||
// returns TRUE if ok, FALSE on error
|
||||
// returns true if ok, false on error
|
||||
bool Ungetch(char c);
|
||||
|
||||
|
||||
@@ -284,7 +284,7 @@ public:
|
||||
wxCountingOutputStream();
|
||||
|
||||
size_t GetSize() const;
|
||||
bool Ok() const { return TRUE; }
|
||||
bool Ok() const { return true; }
|
||||
|
||||
protected:
|
||||
virtual size_t OnSysWrite(const void *buffer, size_t size);
|
||||
@@ -375,9 +375,9 @@ public:
|
||||
void ResetBuffer();
|
||||
|
||||
// NB: the buffer must always be allocated with malloc() if takeOwn is
|
||||
// TRUE as it will be deallocated by free()
|
||||
void SetBufferIO(void *start, void *end, bool takeOwnership = FALSE);
|
||||
void SetBufferIO(void *start, size_t len, bool takeOwnership = FALSE);
|
||||
// true as it will be deallocated by free()
|
||||
void SetBufferIO(void *start, void *end, bool takeOwnership = false);
|
||||
void SetBufferIO(void *start, size_t len, bool takeOwnership = false);
|
||||
void SetBufferIO(size_t bufsize);
|
||||
void *GetBufferStart() const { return m_buffer_start; }
|
||||
void *GetBufferEnd() const { return m_buffer_end; }
|
||||
|
@@ -698,7 +698,7 @@ public:
|
||||
size_t Len() const { return length(); }
|
||||
// string contains any characters?
|
||||
bool IsEmpty() const { return empty(); }
|
||||
// empty string is "FALSE", so !str will return TRUE
|
||||
// empty string is "false", so !str will return true
|
||||
bool operator!() const { return IsEmpty(); }
|
||||
// truncate the string to given length
|
||||
wxString& Truncate(size_t uiLen);
|
||||
@@ -978,10 +978,10 @@ public:
|
||||
int CmpNoCase(const wxChar *psz) const { return wxStricmp(c_str(), psz); }
|
||||
// test for the string equality, either considering case or not
|
||||
// (if compareWithCase then the case matters)
|
||||
bool IsSameAs(const wxChar *psz, bool compareWithCase = TRUE) const
|
||||
bool IsSameAs(const wxChar *psz, bool compareWithCase = true) const
|
||||
{ return (compareWithCase ? Cmp(psz) : CmpNoCase(psz)) == 0; }
|
||||
// comparison with a signle character: returns TRUE if equal
|
||||
bool IsSameAs(wxChar c, bool compareWithCase = TRUE) const
|
||||
// comparison with a signle character: returns true if equal
|
||||
bool IsSameAs(wxChar c, bool compareWithCase = true) const
|
||||
{
|
||||
return (length() == 1) && (compareWithCase ? GetChar(0u) == c
|
||||
: wxToupper(GetChar(0u)) == wxToupper(c));
|
||||
@@ -998,7 +998,7 @@ public:
|
||||
|
||||
// check that the string starts with prefix and return the rest of the
|
||||
// string in the provided pointer if it is not NULL, otherwise return
|
||||
// FALSE
|
||||
// false
|
||||
bool StartsWith(const wxChar *prefix, wxString *rest = NULL) const;
|
||||
|
||||
// get first nCount characters
|
||||
@@ -1035,25 +1035,25 @@ public:
|
||||
|
||||
// trimming/padding whitespace (either side) and truncating
|
||||
// remove spaces from left or from right (default) side
|
||||
wxString& Trim(bool bFromRight = TRUE);
|
||||
wxString& Trim(bool bFromRight = true);
|
||||
// add nCount copies chPad in the beginning or at the end (default)
|
||||
wxString& Pad(size_t nCount, wxChar chPad = wxT(' '), bool bFromRight = TRUE);
|
||||
wxString& Pad(size_t nCount, wxChar chPad = wxT(' '), bool bFromRight = true);
|
||||
|
||||
// searching and replacing
|
||||
// searching (return starting index, or -1 if not found)
|
||||
int Find(wxChar ch, bool bFromEnd = FALSE) const; // like strchr/strrchr
|
||||
int Find(wxChar ch, bool bFromEnd = false) const; // like strchr/strrchr
|
||||
// searching (return starting index, or -1 if not found)
|
||||
int Find(const wxChar *pszSub) const; // like strstr
|
||||
// replace first (or all of bReplaceAll) occurences of substring with
|
||||
// another string, returns the number of replacements made
|
||||
size_t Replace(const wxChar *szOld,
|
||||
const wxChar *szNew,
|
||||
bool bReplaceAll = TRUE);
|
||||
bool bReplaceAll = true);
|
||||
|
||||
// check if the string contents matches a mask containing '*' and '?'
|
||||
bool Matches(const wxChar *szMask) const;
|
||||
|
||||
// conversion to numbers: all functions return TRUE only if the whole
|
||||
// conversion to numbers: all functions return true only if the whole
|
||||
// string is a number and put the value of this number into the pointer
|
||||
// provided, the base is the numeric base in which the conversion should be
|
||||
// done and must be comprised between 2 and 36 or be 0 in which case the
|
||||
@@ -1136,8 +1136,8 @@ public:
|
||||
int First( const wxChar ch ) const { return Find(ch); }
|
||||
int First( const wxChar* psz ) const { return Find(psz); }
|
||||
int First( const wxString &str ) const { return Find(str); }
|
||||
int Last( const wxChar ch ) const { return Find(ch, TRUE); }
|
||||
bool Contains(const wxString& str) const { return Find(str) != -1; }
|
||||
int Last( const wxChar ch ) const { return Find(ch, true); }
|
||||
bool Contains(const wxString& str) const { return Find(str) != wxNOT_FOUND; }
|
||||
|
||||
// use IsEmpty()
|
||||
bool IsNull() const { return IsEmpty(); }
|
||||
|
@@ -6,7 +6,7 @@
|
||||
// Created: 2001-07-10
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_SYSOPT_H_
|
||||
|
Reference in New Issue
Block a user