diff --git a/ZString.cpp b/ZString.cpp index 0b83530..2ed5d41 100644 --- a/ZString.cpp +++ b/ZString.cpp @@ -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; diff --git a/ZString.h b/ZString.h index a8970c2..00a1892 100644 --- a/ZString.h +++ b/ZString.h @@ -296,18 +296,18 @@ namespace coreutils { /// the cursor position is equal to the value provided. /// -// bool ifNext(const char *value); - - /// - /// - /// - bool ifNext(ZString value); /// /// /// + bool ifNextIgnoreCase(ZString value); + + /// + /// + /// + int ifEqualsCount(ZString &comparator); ///