Created ifNextIgnoreCase method for ZString.
This commit is contained in:
1 parent
bf4ff3fdac
commit
2e8bb4a123
2 files changed
+15
-15
No files matched your search
+9
-9
@@ -383,15 +383,6 @@ 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(ZString value) {
|
||||
if (((data + length) - cursor) < value.getLength())
|
||||
return false;
|
||||
@@ -400,6 +391,15 @@ namespace coreutils {
|
||||
cursor += value.getLength();
|
||||
return test;
|
||||
}
|
||||
|
||||
bool ZString::ifNextIgnoreCase(ZString value) {
|
||||
if (((data + length) - cursor) < value.getLength())
|
||||
return false;
|
||||
bool test = (strncasecmp(cursor, value.getCursor(), value.getLength()) == 0);
|
||||
if (test)
|
||||
cursor += value.getLength();
|
||||
return test;
|
||||
}
|
||||
|
||||
int ZString::ifEqualsCount(ZString &comparator) {
|
||||
int count = 0;
|
||||
|
||||
Reference in new issue
Block a user