mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
String::begin/end
git-svn-id: svn://ultimatepp.org/upp/trunk@9940 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
b2559d50a2
commit
d720a38c65
1 changed files with 5 additions and 0 deletions
|
|
@ -42,6 +42,7 @@ public:
|
|||
bool IsEmpty() const { return B::GetCount() == 0; }
|
||||
|
||||
const tchar *End() const { return B::Begin() + GetLength(); }
|
||||
const tchar *end() const { return End(); }
|
||||
const tchar *Last() const { return End() - !!B::GetCount(); }
|
||||
const tchar *GetIter(int i) const { ASSERT(i >= 0 && i <= B::GetCount()); return B::Begin() + i; }
|
||||
|
||||
|
|
@ -309,7 +310,9 @@ public:
|
|||
void Trim(int pos);
|
||||
|
||||
const char *Begin() const { return IsSmall() ? chr : ptr; }
|
||||
const char *begin() const { return Begin(); }
|
||||
const char *End() const { return Begin() + GetLength(); }
|
||||
const char *end() const { return End(); }
|
||||
|
||||
int operator[](int i) const { ASSERT(i >= 0 && i <= GetCount()); return Begin()[i]; }
|
||||
|
||||
|
|
@ -737,6 +740,8 @@ protected:
|
|||
public:
|
||||
const wchar *Begin() const { return ptr; }
|
||||
const wchar *End() const { return Begin() + GetLength(); }
|
||||
const wchar *begin() const { return Begin(); }
|
||||
const wchar *end() const { return End(); }
|
||||
int operator[](int i) const { return ptr[i]; }
|
||||
|
||||
operator const wchar *() const { return Begin(); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue