Modified ifNext to only take the ZString parameter and let C++ do the conversions.

This commit is contained in:
Brad Arant committed 2024-10-30 08:36:30 -07:00
1 parent d0239074a4
commit 3eb1f5954a
4 files changed
+15 -20

No files matched your search

+9 -9
View File
@@ -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);