-
Notifications
You must be signed in to change notification settings - Fork 0
/
StringTokenizer.h
52 lines (38 loc) · 1.55 KB
/
StringTokenizer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
***********************************************************************
* 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>
class StringTokenizer
{
public:
StringTokenizer(const std::string& _str, const std::string& _delim);//!< Constructor
~StringTokenizer(){};//!< Destructor
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;
};
#endif