X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/06b466c74fae8f27544f143abdcabcd2385602e4..961dd75341aaa5083098fefd5c1074d8308b5732:/include/wx/tokenzr.h diff --git a/include/wx/tokenzr.h b/include/wx/tokenzr.h index 34fd063032..dde0752f0b 100644 --- a/include/wx/tokenzr.h +++ b/include/wx/tokenzr.h @@ -2,7 +2,7 @@ // Name: wx/tokenzr.h // Purpose: String tokenizer - a C++ replacement for strtok(3) // Author: Guilhem Lavaux -// Modified by: Vadim Zeitlin +// Modified by: (or rather rewritten by) Vadim Zeitlin // Created: 04/22/98 // RCS-ID: $Id$ // Copyright: (c) Guilhem Lavaux @@ -12,12 +12,13 @@ #ifndef _WX_TOKENZRH #define _WX_TOKENZRH -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "tokenzr.h" #endif #include "wx/object.h" #include "wx/string.h" +#include "wx/arrstr.h" // ---------------------------------------------------------------------------- // constants @@ -41,7 +42,7 @@ enum wxStringTokenizerMode // wxStringTokenizer: replaces infamous strtok() and has some other features // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxStringTokenizer : public wxObject +class WXDLLIMPEXP_BASE wxStringTokenizer : public wxObject { public: // ctors and initializers @@ -117,4 +118,15 @@ protected: bool m_hasMore; // do we have more (possible empty) tokens? }; +// ---------------------------------------------------------------------------- +// convenience function which returns all tokens at once +// ---------------------------------------------------------------------------- + +// the function takes the same parameters as wxStringTokenizer ctor and returns +// the array containing all tokens +wxArrayString WXDLLIMPEXP_BASE +wxStringTokenize(const wxString& str, + const wxString& delims = wxDEFAULT_DELIMITERS, + wxStringTokenizerMode mode = wxTOKEN_DEFAULT); + #endif // _WX_TOKENZRH