diff options
Diffstat (limited to 'CPP/Common/MyString.h')
| -rw-r--r-- | CPP/Common/MyString.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/CPP/Common/MyString.h b/CPP/Common/MyString.h index ba9914e..639b874 100644 --- a/CPP/Common/MyString.h +++ b/CPP/Common/MyString.h | |||
| @@ -429,11 +429,11 @@ public: | |||
| 429 | // int CompareNoCase(const char *s) const { return MyStringCompareNoCase(_chars, s); } | 429 | // int CompareNoCase(const char *s) const { return MyStringCompareNoCase(_chars, s); } |
| 430 | // int CompareNoCase(const AString &s) const { return MyStringCompareNoCase(_chars, s._chars); } | 430 | // int CompareNoCase(const AString &s) const { return MyStringCompareNoCase(_chars, s._chars); } |
| 431 | bool IsPrefixedBy(const char *s) const { return IsString1PrefixedByString2(_chars, s); } | 431 | bool IsPrefixedBy(const char *s) const { return IsString1PrefixedByString2(_chars, s); } |
| 432 | bool IsPrefixedBy_Ascii_NoCase(const char *s) const throw(); | 432 | bool IsPrefixedBy_Ascii_NoCase(const char *s) const { return IsString1PrefixedByString2_NoCase_Ascii(_chars, s); } |
| 433 | 433 | ||
| 434 | bool IsAscii() const | 434 | bool IsAscii() const |
| 435 | { | 435 | { |
| 436 | unsigned len = Len(); | 436 | const unsigned len = Len(); |
| 437 | const char *s = _chars; | 437 | const char *s = _chars; |
| 438 | for (unsigned i = 0; i < len; i++) | 438 | for (unsigned i = 0; i < len; i++) |
| 439 | if ((unsigned char)s[i] >= 0x80) | 439 | if ((unsigned char)s[i] >= 0x80) |
| @@ -727,22 +727,23 @@ public: | |||
| 727 | // int CompareNoCase(const wchar_t *s) const { return MyStringCompareNoCase(_chars, s); } | 727 | // int CompareNoCase(const wchar_t *s) const { return MyStringCompareNoCase(_chars, s); } |
| 728 | // int CompareNoCase(const UString &s) const { return MyStringCompareNoCase(_chars, s._chars); } | 728 | // int CompareNoCase(const UString &s) const { return MyStringCompareNoCase(_chars, s._chars); } |
| 729 | bool IsPrefixedBy(const wchar_t *s) const { return IsString1PrefixedByString2(_chars, s); } | 729 | bool IsPrefixedBy(const wchar_t *s) const { return IsString1PrefixedByString2(_chars, s); } |
| 730 | bool IsPrefixedBy(const char *s) const { return IsString1PrefixedByString2(_chars, s); } | ||
| 730 | bool IsPrefixedBy_NoCase(const wchar_t *s) const { return IsString1PrefixedByString2_NoCase(_chars, s); } | 731 | bool IsPrefixedBy_NoCase(const wchar_t *s) const { return IsString1PrefixedByString2_NoCase(_chars, s); } |
| 731 | bool IsPrefixedBy_Ascii_NoCase(const char *s) const throw(); | 732 | bool IsPrefixedBy_Ascii_NoCase(const char *s) const { return IsString1PrefixedByString2_NoCase_Ascii(_chars, s); } |
| 732 | 733 | ||
| 733 | bool IsAscii() const | 734 | bool IsAscii() const |
| 734 | { | 735 | { |
| 735 | unsigned len = Len(); | 736 | const unsigned len = Len(); |
| 736 | const wchar_t *s = _chars; | 737 | const wchar_t *s = _chars; |
| 737 | for (unsigned i = 0; i < len; i++) | 738 | for (unsigned i = 0; i < len; i++) |
| 738 | if (s[i] >= 0x80) | 739 | if ((unsigned)(int)s[i] >= 0x80) |
| 739 | return false; | 740 | return false; |
| 740 | return true; | 741 | return true; |
| 741 | } | 742 | } |
| 742 | int Find(wchar_t c) const { return FindCharPosInString(_chars, c); } | 743 | int Find(wchar_t c) const { return FindCharPosInString(_chars, c); } |
| 743 | int Find(wchar_t c, unsigned startIndex) const | 744 | int Find(wchar_t c, unsigned startIndex) const |
| 744 | { | 745 | { |
| 745 | int pos = FindCharPosInString(_chars + startIndex, c); | 746 | const int pos = FindCharPosInString(_chars + startIndex, c); |
| 746 | return pos < 0 ? -1 : (int)startIndex + pos; | 747 | return pos < 0 ? -1 : (int)startIndex + pos; |
| 747 | } | 748 | } |
| 748 | 749 | ||
