| Index: runtime/vm/object.h
|
| diff --git a/runtime/vm/object.h b/runtime/vm/object.h
|
| index 07cb5bf6810a4918fbf3a6ffd74f419c27709944..a36be5d17a1d37ad5551fc6d62c6f873545775ae 100644
|
| --- a/runtime/vm/object.h
|
| +++ b/runtime/vm/object.h
|
| @@ -3708,6 +3708,29 @@ class String : public Instance {
|
| static const intptr_t kSizeofRawString = sizeof(RawObject) + (2 * kWordSize);
|
| static const intptr_t kMaxElements = kSmiMax / kTwoByteChar;
|
|
|
| + class CodePointIterator : public ValueObject {
|
| + public:
|
| + explicit CodePointIterator(const String& str)
|
| + : str_(str),
|
| + index_(-1),
|
| + ch_(-1) {
|
| + }
|
| +
|
| + int32_t Current() {
|
| + ASSERT(index_ >= 0);
|
| + ASSERT(index_ < str_.Length());
|
| + return ch_;
|
| + }
|
| +
|
| + bool Next();
|
| +
|
| + private:
|
| + const String& str_;
|
| + intptr_t index_;
|
| + int32_t ch_;
|
| + DISALLOW_IMPLICIT_CONSTRUCTORS(CodePointIterator);
|
| + };
|
| +
|
| intptr_t Length() const { return Smi::Value(raw_ptr()->length_); }
|
| static intptr_t length_offset() { return OFFSET_OF(RawString, length_); }
|
|
|
|
|