X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ce3ed50dbe32d118321082db84c3a9abb047d5b7..cf471cab8277f4cc2c19bce417356badf9e2ca49:/src/common/tokenzr.cpp diff --git a/src/common/tokenzr.cpp b/src/common/tokenzr.cpp index 34079c0f66..0601d5d0e5 100644 --- a/src/common/tokenzr.cpp +++ b/src/common/tokenzr.cpp @@ -2,113 +2,129 @@ // Name: tokenzr.cpp // Purpose: String tokenizer // Author: Guilhem Lavaux -// Modified by: +// Modified by: Vadim Zeitlin // Created: 04/22/98 // RCS-ID: $Id$ // Copyright: (c) Guilhem Lavaux // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + #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 -#endif - -#ifndef WX_PRECOMP + #pragma hdrstop #endif -#include "wx/object.h" -#include "wx/string.h" #include "wx/tokenzr.h" +// ============================================================================ +// implementation +// ============================================================================ + +// ---------------------------------------------------------------------------- +// wxStringTokenizer construction +// ---------------------------------------------------------------------------- + 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; + SetString(to_tokenize, delims, ret_delims); } -wxStringTokenizer::~wxStringTokenizer() +void wxStringTokenizer::SetString(const wxString& to_tokenize, + const wxString& delims, + bool ret_delim) { -} + m_string = to_tokenize; + m_delims = delims; + m_retdelims = ret_delim; + m_pos = 0; -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;i