#define DONT_INCLUDE_AFXTEMPL #include "CTokenizer.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif CTokenizer::CTokenizer(char *str, const char *newLineChars, const char *spaceChars) : mNext(str) , mCurrent(NULL) , mNewLineChars(newLineChars) , mSpaceChars(spaceChars) { #line 31 _ASSERT(mNext); if (!mNewLineChars) mNewLineChars = "\r\n\t"; if (!mSpaceChars) mSpaceChars = " \r\n\t"; } /*virtual*/ CTokenizer::~CTokenizer() { } CTokenizer& CTokenizer::operator=(char *str) { mNext = str; mCurrent = NULL; #line 49 _ASSERT(mNext); return *this; } const char* CTokenizer::NextToken(const char *delim) { #line 58 _ASSERT(delim); mCurrent = mNext; if (mNext) { mNext = (char *) _mbspbrk((unsigned char *) mNext, (const unsigned char *) delim); if (mNext) { mNext[0] = 0; mNext++; mNext += _mbsspn((unsigned char *) mNext, (const unsigned char *) delim); if (mNext[0] == 0) mNext = NULL; } } return mCurrent; }