00001 /* 00002 * $Id: Tokenizer.h 562 2007-12-02 08:04:16Z mindstorm2600 $ 00003 * 00004 * X-VR2 00005 * 00006 * Copyright (C) Juan V. Guerrero 2007 00007 * 00008 * Juan V. Guerrero <mindstorm2600@users.sourceforge.net> 00009 * 00010 * This program is free software, distributed under the terms of 00011 * the GNU General Public License Version 2. See the LICENSE file 00012 * at the top of the source tree. 00013 */ 00014 #ifndef __XVR2_TOKENIZER_H__ 00015 #define __XVR2_TOKENIZER_H__ 00016 #include<xvr2/System.h> 00017 #include<xvr2/String.h> 00018 #include<xvr2/CoreExceptions.h> 00019 00020 namespace xvr2{ 00021 00026 class Tokenizer:public System{ 00027 private: 00029 char *temp; 00031 char *buffer; 00033 char *token; 00035 char *delim; 00037 String tstr; 00039 bool _fin; 00040 protected: 00042 char *cnext(); 00043 public: 00048 Tokenizer(char *string, char *delim) ; 00053 Tokenizer(const String &string, const String &delim) ; 00056 ~Tokenizer (); 00060 const String &next(); 00063 bool finished(); 00064 }; 00065 00066 00067 } 00068 00069 #endif