Tokenize.h

00001 
00002 #ifndef SCT_TOKENIZE_H
00003 #define SCT_TOKENIZE_H
00004 
00005 #include <string>
00006 #include <vector>
00007 #include <list>
00008 
00009 namespace Sct {
00010 
00011   class Tokenize {
00012   public:
00013     typedef std::list<std::string> Tokens;
00014   private:
00015     Tokens m_tokens;
00016   public:
00017     typedef std::list<std::string> Tokens;
00018     typedef std::vector<std::string> TokenVec;
00019     Tokenize(const std::string& str,
00020          const std::string& delimiters = " ");
00021     Tokens::const_iterator begin() const {
00022       return m_tokens.begin();
00023     };
00024     Tokens::const_iterator end() const {
00025       return m_tokens.end();
00026     };
00027     Tokens::iterator begin() {
00028       return m_tokens.begin();
00029     };
00030     Tokens::iterator end() {
00031       return m_tokens.end();
00032     };
00033     const Tokens & tokens() const {
00034       return m_tokens;
00035     };
00036     TokenVec tokenVec() const;
00037     Tokens & tokens() {
00038       return m_tokens;
00039     };
00040     unsigned int size() const {
00041       return m_tokens.size();
00042     };
00043     bool empty() const {
00044       return m_tokens.empty();
00045     };
00046   };
00047 
00048 };
00049 
00050 #endif

Generated on Mon Feb 6 14:01:36 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6