Modified ifNext to only take the ZString parameter and let C++ do the conversions.
This commit is contained in:
1 parent
d0239074a4
commit
3eb1f5954a
4 files changed
+15
-20
No files matched your search
+9
-9
@@ -377,16 +377,16 @@ namespace coreutils {
|
||||
return string == std::string(data, length);
|
||||
}
|
||||
|
||||
bool ZString::ifNext(const char *value) {
|
||||
if (((data + length) - cursor) < strlen(value))
|
||||
return false;
|
||||
bool test = (strncmp(cursor, value, strlen(value)) == 0);
|
||||
if (test)
|
||||
cursor += strlen(value);
|
||||
return test;
|
||||
}
|
||||
// bool ZString::ifNext(const char *value) {
|
||||
// if (((data + length) - cursor) < strlen(value)/)
|
||||
// return false;
|
||||
// bool test = (strncmp(cursor, value, strlen(value)) == 0);
|
||||
// if (test)
|
||||
// cursor += strlen(value);
|
||||
// return test;
|
||||
// }
|
||||
|
||||
bool ZString::ifNext(ZString &value) {
|
||||
bool ZString::ifNext(ZString value) {
|
||||
if (((data + length) - cursor) < value.getLength())
|
||||
return false;
|
||||
bool test = (strncmp(cursor, value.getCursor(), value.getLength()) == 0);
|
||||
|
||||
Reference in new issue
Block a user