1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- /*
- ***********************************************************************
- * Class: StringTokenizer *
- * By Arash Partow - 2000 *
- * URL: http://www.partow.net/programming/stringtokenizer/index.html *
- * *
- * Copyright Notice: *
- * Free use of this library is permitted under the guidelines and *
- * in accordance with the most current version of the Common Public *
- * License. *
- * http://www.opensource.org/licenses/cpl.php *
- * *
- ***********************************************************************
- */
- #ifndef INCLUDE_STRINGTOKENIZER_H
- #define INCLUDE_STRINGTOKENIZER_H
- #include <stdio.h>
- #include <stdlib.h>
- #include <iostream>
- #include <string>
- namespace csr {
- class StringTokenizer {
- public:
- StringTokenizer(const std::string& _str, const std::string& _delim);
- ~StringTokenizer(){};
- int countTokens();
- bool hasMoreTokens();
- std::string nextToken();
- int nextIntToken();
- double nextFloatToken();
- std::string nextToken(const std::string& delim);
- std::string remainingString();
- std::string filterNextToken(const std::string& filterStr);
- private:
- std::string token_str;
- std::string delim;
- };
- } // namespace csr {
- #endif
|