blob: 4818952124da93d14b852dbc1a7958d0cf8fc41d [file] [log] [blame]
#ifndef NLSR_TOKENIZER_HPP
#define NLSR_TOKENIZER_HPP
#include <iostream>
#include <boost/tokenizer.hpp>
#include <boost/algorithm/string.hpp>
#include <string>
#include <list>
#include <ndn-cpp-dev/face.hpp>
namespace nlsr
{
using namespace std;
using namespace boost;
class nlsrTokenizer
{
public:
nlsrTokenizer(const string& inputString)
:firstToken(),
restOfTheLine()
{
seps = " ";
originalString = inputString;
makeToken();
}
nlsrTokenizer(const string& inputString, const string& separator)
:firstToken(),
restOfTheLine()
{
seps = separator;
originalString = inputString;
makeToken();
}
string getFirstToken()
{
return firstToken;
}
string getRestOfLine()
{
return restOfTheLine;
}
int getTokenPosition(string& token);
string getTokenString(int from , int to);
string getTokenString(int from);
bool doesTokenExist(string token);
private:
void makeToken();
void insertToken(const string& token);
string seps;
string originalString;
string firstToken;
string restOfTheLine;
std::list<string> tokenList;
};
}//namespace nlsr
#endif