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

Comparing branches/new_design/OOPSE-3.0/src/utils/StringTokenizer.cpp (file contents):
Revision 1757 by tim, Tue Nov 16 02:07:14 2004 UTC vs.
Revision 1758 by tim, Fri Nov 19 17:56:32 2004 UTC

# Line 125 | Line 125 | int StringTokenizer::nextTokenAsInt() {
125      return result;
126   }
127  
128 + bool StringTokenizer::nextTokenAsBool() {
129 +    std::string token = nextToken();
130 +    std::istringstream iss(token);
131 +    bool result;
132 +    
133 +    if (iss >> result) {
134 +        return result;
135 +    } else {
136 +        std::err << "unable to convert " << token << "to a bool" << std::endl;
137 +        return false;
138 +    }
139 + }
140 +
141   int StringTokenizer::nextTokenAsInt() {
142      std::string token = nextToken();
143      std::istringstream iss(token);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines