NLSR - (Hello Protocol + FIB Update)
diff --git a/src/utility/nlsr_tokenizer.hpp b/src/utility/nlsr_tokenizer.hpp
index 6cd97e0..4b84d8b 100644
--- a/src/utility/nlsr_tokenizer.hpp
+++ b/src/utility/nlsr_tokenizer.hpp
@@ -12,93 +12,93 @@
namespace nlsr
{
- using namespace std;
- using namespace boost;
+ using namespace std;
+ using namespace boost;
- class nlsrTokenizer
+ class nlsrTokenizer
+ {
+ public:
+ nlsrTokenizer(const string& inputString)
+ : firstToken()
+ , restOfTheLine()
+ , currentPosition(0)
{
- public:
- nlsrTokenizer(const string& inputString)
- : firstToken()
- , restOfTheLine()
- , currentPosition(0)
- {
- seps = " ";
- originalString = inputString;
- makeToken();
- }
+ seps = " ";
+ originalString = inputString;
+ makeToken();
+ }
- nlsrTokenizer(const string& inputString, const string& separator)
- : firstToken()
- , restOfTheLine()
- , currentPosition(0)
- {
- seps = separator;
- originalString = inputString;
- makeToken();
- }
+ nlsrTokenizer(const string& inputString, const string& separator)
+ : firstToken()
+ , restOfTheLine()
+ , currentPosition(0)
+ {
+ seps = separator;
+ originalString = inputString;
+ makeToken();
+ }
- string getFirstToken()
- {
- return firstToken;
- }
+ string getFirstToken()
+ {
+ return firstToken;
+ }
- string getRestOfLine()
- {
- return restOfTheLine;
- }
+ string getRestOfLine()
+ {
+ return restOfTheLine;
+ }
- void resetCurrentPosition(uint32_t cp=0)
- {
- if( cp >=0 && cp <= vTokenList.size() )
- {
- currentPosition=cp;
- }
- }
+ void resetCurrentPosition(uint32_t cp=0)
+ {
+ if( cp >=0 && cp <= vTokenList.size() )
+ {
+ currentPosition=cp;
+ }
+ }
- string getNextToken()
- {
- if(currentPosition >= 0 && currentPosition <= (vTokenList.size()-1))
- {
- return vTokenList[currentPosition++];
- }
- return "";
- }
+ string getNextToken()
+ {
+ if(currentPosition >= 0 && currentPosition <= (vTokenList.size()-1))
+ {
+ return vTokenList[currentPosition++];
+ }
+ return "";
+ }
- uint32_t getTokenNumber()
- {
- return tokenList.size();
- }
+ uint32_t getTokenNumber()
+ {
+ return tokenList.size();
+ }
- string getToken(int position)
- {
- if( position >=0 && position <vTokenList.size() )
- {
- return vTokenList[position];
- }
- return "";
- }
+ string getToken(int position)
+ {
+ if( position >=0 && position <vTokenList.size() )
+ {
+ return vTokenList[position];
+ }
+ return "";
+ }
- int getTokenPosition(string& token);
- string getTokenString(int from , int to);
- string getTokenString(int from);
- bool doesTokenExist(string token);
+ int getTokenPosition(string& token);
+ string getTokenString(int from , int to);
+ string getTokenString(int from);
+ bool doesTokenExist(string token);
- private:
+ private:
- void makeToken();
- void insertToken(const string& token);
- void makeRestOfTheLine();
+ void makeToken();
+ void insertToken(const string& token);
+ void makeRestOfTheLine();
- string seps;
- string originalString;
- string firstToken;
- string restOfTheLine;
- std::list<string> tokenList;
- std::vector<string> vTokenList;
- uint32_t currentPosition;
- };
+ string seps;
+ string originalString;
+ string firstToken;
+ string restOfTheLine;
+ std::list<string> tokenList;
+ std::vector<string> vTokenList;
+ uint32_t currentPosition;
+ };
}//namespace nlsr
#endif