Fix String::{Begins,Ends}With and with it a bunch of stuff

This commit is contained in:
mniip 2018-05-03 04:12:09 +03:00
parent 5ff8cefca4
commit ecb41661f8

View File

@ -77,8 +77,8 @@ public:
inline bool Contains(value_type ch) const { return super::find(ch) != npos; }
inline bool Contains(ByteString const &other) { return super::find(other) != npos; }
inline bool BeginsWith(ByteString const &other) const { return super::compare(0, other.size(), other); }
inline bool EndsWith(ByteString const &other) const { return super::compare(size() - other.size(), other.size(), other); }
inline bool BeginsWith(ByteString const &other) const { return !super::compare(0, other.size(), other); }
inline bool EndsWith(ByteString const &other) const { return !super::compare(size() - other.size(), other.size(), other); }
using Split = SplitBase<ByteString>;
inline Split SplitBy(value_type ch, size_t pos = 0) const { return Split(*this, pos, super::find(ch, pos), 1, false); }
@ -168,8 +168,8 @@ public:
inline bool Contains(value_type ch) const { return super::find(ch) != npos; }
inline bool Contains(String const &other) const { return super::find(other) != npos; }
inline bool BeginsWith(String const &other) const { return super::compare(0, other.size(), other); }
inline bool EndsWith(String const &other) const { return super::compare(size() - other.size(), other.size(), other); }
inline bool BeginsWith(String const &other) const { return !super::compare(0, other.size(), other); }
inline bool EndsWith(String const &other) const { return !super::compare(size() - other.size(), other.size(), other); }
using Split = SplitBase<String>;
inline Split SplitBy(value_type ch, size_t pos = 0) const { return Split(*this, pos, super::find(ch, pos), 1, false); }