File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 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
742742
743743float String::toFloat (void ) const
744744{
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);
746751 return 0 ;
747752}
Original file line number Diff line number Diff line change @@ -161,6 +161,10 @@ class String
161161 void toCharArray (char *buf, unsigned int bufsize, unsigned int index=0 ) const
162162 {getBytes ((unsigned char *)buf, bufsize, index);}
163163 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 (); }
164168
165169 // search
166170 int indexOf ( char ch ) const ;
@@ -186,6 +190,7 @@ class String
186190 // parsing/conversion
187191 long toInt (void ) const ;
188192 float toFloat (void ) const ;
193+ double toDouble (void ) const ;
189194
190195protected:
191196 char *buffer; // the actual char array
You can’t perform that action at this time.
0 commit comments