File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -742,6 +742,11 @@ long String::toInt(void) const
742
742
743
743
float String::toFloat (void ) const
744
744
{
745
- if (buffer) return float (atof (buffer));
745
+ return float (toDouble ());
746
+ }
747
+
748
+ double String::toDouble (void ) const
749
+ {
750
+ if (buffer) return atof (buffer);
746
751
return 0 ;
747
752
}
Original file line number Diff line number Diff line change @@ -161,6 +161,10 @@ class String
161
161
void toCharArray (char *buf, unsigned int bufsize, unsigned int index=0 ) const
162
162
{getBytes ((unsigned char *)buf, bufsize, index );}
163
163
const char * c_str () const { return buffer; }
164
+ char * begin () { return buffer; }
165
+ char * end () { return buffer + length (); }
166
+ const char * begin () const { return c_str (); }
167
+ const char * end () const { return c_str () + length (); }
164
168
165
169
// search
166
170
int indexOf ( char ch ) const ;
@@ -186,6 +190,7 @@ class String
186
190
// parsing/conversion
187
191
long toInt (void ) const ;
188
192
float toFloat (void ) const ;
193
+ double toDouble (void ) const ;
189
194
190
195
protected:
191
196
char *buffer; // the actual char array
You can’t perform that action at this time.
0 commit comments