mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:27:45 +00:00
AK: Add generic SimpleIterator class to replace VectorIterator.
This commit is contained in:
parent
9648bf4ada
commit
1b3ecb01a5
8 changed files with 152 additions and 90 deletions
|
@ -58,8 +58,6 @@ namespace AK {
|
|||
|
||||
class String {
|
||||
public:
|
||||
using ConstIterator = const char*;
|
||||
|
||||
~String() { }
|
||||
|
||||
String() { }
|
||||
|
@ -155,8 +153,10 @@ public:
|
|||
return (*m_impl)[i];
|
||||
}
|
||||
|
||||
ConstIterator begin() const { return characters(); }
|
||||
ConstIterator end() const { return begin() + length(); }
|
||||
using ConstIterator = SimpleIterator<const String, const char>;
|
||||
|
||||
constexpr ConstIterator begin() const { return ConstIterator::begin(*this); }
|
||||
constexpr ConstIterator end() const { return ConstIterator::end(*this); }
|
||||
|
||||
bool starts_with(const StringView&, CaseSensitivity = CaseSensitivity::CaseSensitive) const;
|
||||
bool ends_with(const StringView&, CaseSensitivity = CaseSensitivity::CaseSensitive) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue