From 85833f5c6c5c136d16ccd01c90cc243d5d025e0a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 10 Jun 1999 21:16:58 +0000 Subject: [PATCH] WXDLLEXPORT added to wxStringTokenizer (and also several "const"s here and there...) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2752 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/tokenzr.h | 60 +++++++-------- src/common/tokenzr.cpp | 162 +++++++++++++++++++++------------------ src/generic/helphtml.cpp | 34 ++++---- src/msw/dcclient.cpp | 2 +- 4 files changed, 134 insertions(+), 124 deletions(-) diff --git a/include/wx/tokenzr.h b/include/wx/tokenzr.h index 8012854ac6..74b8e25d7f 100644 --- a/include/wx/tokenzr.h +++ b/include/wx/tokenzr.h @@ -20,38 +20,38 @@ #include "wx/string.h" #include "wx/filefn.h" -class wxStringTokenizer : public wxObject { +class WXDLLEXPORT wxStringTokenizer : public wxObject +{ public: - wxStringTokenizer(const wxString& to_tokenize, - const wxString& delims = " \t\r\n", - bool ret_delim = FALSE); - wxStringTokenizer() { m_string = ""; m_delims = ""; m_retdelims = FALSE;} - ~wxStringTokenizer(); - - int CountTokens(); - bool HasMoreToken(); - inline bool HasMoreTokens() { return HasMoreToken(); }; - wxString NextToken(); - // A better name! - inline wxString GetNextToken() { return NextToken(); }; - wxString GetString() { return m_string; } - - void SetString(const wxString& to_tokenize, - const wxString& delims = " \t\r\n", - bool ret_delim = FALSE) - { - m_string = to_tokenize; - m_delims = delims; - m_retdelims = ret_delim; - } + wxStringTokenizer(const wxString& to_tokenize, + const wxString& delims = " \t\r\n", + bool ret_delim = FALSE); + wxStringTokenizer() { m_retdelims = FALSE;} + virtual ~wxStringTokenizer(); + + int CountTokens() count; + bool HasMoreTokens(); + + wxString NextToken(); + wxString GetNextToken() { return NextToken(); }; + + wxString GetString() const { return m_string; } + + void SetString(const wxString& to_tokenize, + const wxString& delims = " \t\r\n", + bool ret_delim = FALSE) + { + m_string = to_tokenize; + m_delims = delims; + m_retdelims = ret_delim; + } protected: - off_t FindDelims(const wxString& str, const wxString& delims); - void EatLeadingDelims(); // AVS - added to fix leading whitespace / - // mult. delims bugs -protected: - wxString m_string, m_delims; - bool m_retdelims; + off_t FindDelims(const wxString& str, const wxString& delims); + void EatLeadingDelims(); + + wxString m_string, m_delims; + bool m_retdelims; }; -#endif +#endif // _WX_TOKENZRH diff --git a/src/common/tokenzr.cpp b/src/common/tokenzr.cpp index 19ae5e0f29..0307ac3a54 100644 --- a/src/common/tokenzr.cpp +++ b/src/common/tokenzr.cpp @@ -10,31 +10,25 @@ ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ -#pragma implementation "tokenzr.h" + #pragma implementation "tokenzr.h" #endif // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif -#ifndef WX_PRECOMP -#endif - -#include "wx/object.h" -#include "wx/string.h" #include "wx/tokenzr.h" wxStringTokenizer::wxStringTokenizer(const wxString& to_tokenize, const wxString& delims, - bool ret_delims) - : wxObject() + bool ret_delims) { - m_string = to_tokenize; - m_delims = delims; - m_retdelims = ret_delims; + m_string = to_tokenize; + m_delims = delims; + m_retdelims = ret_delims; } wxStringTokenizer::~wxStringTokenizer() @@ -43,86 +37,102 @@ wxStringTokenizer::~wxStringTokenizer() off_t wxStringTokenizer::FindDelims(const wxString& str, const wxString& delims) { - int i, j; - register int s_len = str.Length(), - len = delims.Length(); - - for (i=0;iFirst(); wxExtHelpMapEntry *entry; - + compA = k; compA.LowerCase(); // we compare case insensitive while(node) { entry = (wxExtHelpMapEntry *)node->Data(); compB = entry->doc; compB.LowerCase(); - if((showAll || compB.Contains(k)) && ! compB.IsEmpty()) + if((showAll || compB.Contains(k)) && ! compB.IsEmpty()) { urls[idx] = entry->url; // doesn't work: @@ -266,19 +266,19 @@ wxHTMLHelpControllerBase::KeywordSearch(const wxString& k) } delete[] urls; delete[] choices; - + return rc; } bool -wxHTMLHelpControllerBase::Quit(void) +wxHTMLHelpControllerBase::Quit() { return TRUE; } void -wxHTMLHelpControllerBase::OnQuit(void) +wxHTMLHelpControllerBase::OnQuit() { } diff --git a/src/msw/dcclient.cpp b/src/msw/dcclient.cpp index bbffc5a65a..75fe09b4c1 100644 --- a/src/msw/dcclient.cpp +++ b/src/msw/dcclient.cpp @@ -161,7 +161,7 @@ wxClientDC::~wxClientDC() // So we store a list of windows for which we already have the DC and not // just one single hDC. This seems to work, but I'm really not sure about // the usefullness of the whole idea - IMHO it's much better to not call -// base class OnPaint() at all, or, if we realyl want to allow it, add a +// base class OnPaint() at all, or, if we really want to allow it, add a // "wxPaintDC *" parameter to wxPaintEvent which should be used if it's // !NULL instead of creating a new DC. -- 2.45.2