Changed startsWithDouble to startsWithNumber.
This commit is contained in:
parent
974a509767
commit
e2d20a0c2d
@ -322,13 +322,8 @@ namespace coreutils {
|
||||
return strncmp(cursor, value, strlen(value)) == 0;
|
||||
}
|
||||
|
||||
bool ZString::startsWithDouble() {
|
||||
push();
|
||||
char *tempc = cursor;
|
||||
double temp = strtod(cursor, &cursor);
|
||||
int diff = cursor - tempc;
|
||||
pop();
|
||||
return diff != 0;
|
||||
bool ZString::startsWithNumber() {
|
||||
return ((*cursor >= '0') && (*cursor <= '9'));
|
||||
}
|
||||
|
||||
int ZString::compare(ZString zstring) {
|
||||
|
@ -252,7 +252,7 @@ namespace coreutils {
|
||||
///
|
||||
///
|
||||
|
||||
bool startsWithDouble();
|
||||
bool startsWithNumber();
|
||||
|
||||
///
|
||||
///
|
||||
|
@ -100,7 +100,7 @@ int main(int argc, char **argv) {
|
||||
test18.reset();
|
||||
std::cout << "[" << test18.find("x") << "] " << test18.parsed() << ":" << test18.unparsed() << std::endl;
|
||||
|
||||
coreutils::ZString test19("-16473.65476Z");
|
||||
coreutils::ZString test19("1,");
|
||||
std::cout << test19.asDouble() << ":" << test19.unparsed() << std::endl;
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user