MRXT: The Multi-Robot eXploration Tool
Multi-Robot autonomous exploration and mapping simulator.
|
00001 #ifndef __StringTokenizer_H__ 00002 #define __StringTokenizer_H__ 00003 00004 #include <stdio.h> 00005 #include <stdlib.h> 00006 #include <string.h> 00007 00008 /** 00009 * @brief Splits a string in substrings separated by a delimiter 00010 * 00011 */ 00012 class StringTokenizer { 00013 00014 private: 00015 /// String tokenizer node 00016 typedef struct Nodo { 00017 struct Nodo *next; 00018 char *token; 00019 } Nodo; 00020 00021 int nTokens; 00022 Nodo *first; 00023 Nodo *last; 00024 Nodo *next; 00025 int addToken(char *token, int size); 00026 00027 public: 00028 StringTokenizer(char *line, char *delim = " "); 00029 virtual ~StringTokenizer(); 00030 char *nextToken(char *delim = " "); 00031 int countTokens(); 00032 int hasMoreTokens(); 00033 }; 00034 00035 #endif 00036 00037 00038 00039 00040 00041