ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-4/src/utils/StringTokenizer.hpp
(Generate patch)

Comparing branches/new_design/OOPSE-4/src/utils/StringTokenizer.hpp (file contents):
Revision 1779 by tim, Wed Nov 17 06:37:56 2004 UTC vs.
Revision 1780 by tim, Wed Nov 24 19:49:07 2004 UTC

# Line 32 | Line 32
32   */
33  
34   #ifndef UTIL_STRINGTOKENIZER_HPP
35
35   #define UTIL_STRINGTOKENIZER_HPP
36  
37   #include <string>
38  
40 //#include "util/NoSuchElementException.hpp"
41
39   namespace oopse {
40  
41   /**
# Line 52 | Line 49 | class StringTokenizer {
49   class StringTokenizer {
50      public:
51  
55        static const std::string defaultDelim;
52          /**
53           * Constructs a string tokenizer for the specified string. The characters in the delim argument
54           * are the delimiters for separating tokens. characters are skipped and only serve as
# Line 63 | Line 59 | class StringTokenizer {
59           * Boost's tokenizer class is one of them
60           */
61          StringTokenizer(const std::string & str,
62 <                        const std::string & delim = defaultDelim);
62 >                        const std::string & delim = " \t\n\r");
63  
64          /**
65           * Constructs a string tokenizer for an iterator range [first, last). The characters in the delim argument
# Line 76 | Line 72 | class StringTokenizer {
72           * Boost's tokenizer class is one of them
73           */
74          StringTokenizer(std::string::const_iterator& first, std::string::const_iterator& last,
75 <                        const std::string & delim = defaultDelim);
75 >                        const std::string & delim = " \t\n\r");
76  
77          /**
78           * Constructs a string tokenizer for the specified string. The characters in the delim argument
# Line 111 | Line 107 | class StringTokenizer {
107           */
108          std::string nextToken();
109  
110 +        //actually, nextToken Can be template function
111 +        //template <typename ReturnType>
112 +        //ReturnType nextToken();
113 +        
114          /**
115 +         * Returns the next token from this string tokenizer as a bool.
116 +         * @return the next token from this string tokenizer  as a bool.
117 +         */
118 +        bool nextTokenAsBool();
119 +
120 +        /**
121           * Returns the next token from this string tokenizer as an integer.
122           * @return the next token from this string tokenizer  as an integer.
123           */
# Line 158 | Line 164 | class StringTokenizer {
164           * @param c character to be tested
165           * @return true if character is in current delimiter set, flase otherwise.
166           */
167 <        bool isDelimiter(char c);
167 >        bool isDelimiter(const char c);
168  
169          std::string tokenString_;
170  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines