#pragma once #include "common.h" class AFX_CLASS_EXPORT CTokenizer { public: CTokenizer(char *str, const char *newLineChars = NULL, const char *spaceChars = NULL); virtual ~CTokenizer(); CTokenizer& operator=(char *str); const char* Current() const { return mCurrent; } const char* NextString(const char *delim = NULL) { return NextToken(delim ? delim : mNewLineChars); } const char* NextWord(const char *delim = NULL) { return NextToken(delim ? delim : mSpaceChars); } int NextInteger(const char *delim = NULL) { return atoi(NextToken(delim ? delim : mSpaceChars)); } protected: const char* NextToken(const char *delim); char *mNext; char *mCurrent; const char *mNewLineChars; const char *mSpaceChars; };