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;
|
return strncmp(cursor, value, strlen(value)) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ZString::startsWithDouble() {
|
bool ZString::startsWithNumber() {
|
||||||
push();
|
return ((*cursor >= '0') && (*cursor <= '9'));
|
||||||
char *tempc = cursor;
|
|
||||||
double temp = strtod(cursor, &cursor);
|
|
||||||
int diff = cursor - tempc;
|
|
||||||
pop();
|
|
||||||
return diff != 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ZString::compare(ZString zstring) {
|
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();
|
test18.reset();
|
||||||
std::cout << "[" << test18.find("x") << "] " << test18.parsed() << ":" << test18.unparsed() << std::endl;
|
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;
|
std::cout << test19.asDouble() << ":" << test19.unparsed() << std::endl;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user