Augustus 3.4.0
Loading...
Searching...
No Matches
tokenizer.hh
1
2/*
3* added by Giovanna Migliorelli 24.07.2019
4* Tokenizer class can handle more than one separator at the time
5* aknowledgement : https://stackoverflow.com/questions/53849/how-do-i-tokenize-a-string-in-c
6* todo : make it a template
7*/
8
9#ifndef TOKENIZER_HH
10#define TOKENIZER_HH
11
12#include <string>
13using namespace std;
14
16{
17 public:
18 static const std::string DELIMITERS;
19 Tokenizer(const std::string& str);
20 Tokenizer(const std::string& str, const std::string& delimiters);
21 bool NextToken();
22 bool NextTokenBlank();
23 bool NextTokenBlank(const std::string& delimiters);
24 bool NextToken(const std::string& delimiters);
25 string GetToken(){return m_token;};
26 void Reset();
27 protected:
28 const std::string m_string;
29 size_t m_offset;
30 int m_blanks;
31 std::string m_token;
32 std::string m_delimiters;
33};
34
35
36#endif
Definition tokenizer.hh:16