Chromium Code Reviews| Index: runtime/vm/object.h |
| diff --git a/runtime/vm/object.h b/runtime/vm/object.h |
| index 240f3eddc5b5ab0dfaff519cf0a3577b67e23b7f..b5af323aa7ead5f75f839362db292febc8af02cc 100644 |
| --- a/runtime/vm/object.h |
| +++ b/runtime/vm/object.h |
| @@ -2303,6 +2303,7 @@ class String : public Instance { |
| static intptr_t Hash(const uint32_t* characters, intptr_t len); |
| virtual int32_t CharAt(intptr_t index) const; |
| + virtual void SetCharAt(intptr_t index, int32_t value) const; |
|
Ivan Posva
2011/10/18 22:01:13
This should only be accessible to very few limited
cshapiro
2011/10/20 02:35:05
I have added a Transform method that is safe to us
Ivan Posva
2011/10/21 14:03:37
Looks a lot cleaner.
|
| bool Equals(const String& str, intptr_t begin_index, intptr_t len) const; |
| bool Equals(const char* str) const; |
| @@ -2364,6 +2365,11 @@ class String : public Instance { |
| intptr_t length, |
| Heap::Space space = Heap::kNew); |
| + static RawString* ToUpperCase(const String& str, |
| + Heap::Space space = Heap::kNew); |
| + static RawString* ToLowerCase(const String& str, |
| + Heap::Space space = Heap::kNew); |
| + |
| static RawString* NewSymbol(const char* str); |
| template<typename T> |
| static RawString* NewSymbol(const T* characters, intptr_t len); |
| @@ -2399,6 +2405,10 @@ class OneByteString : public String { |
| virtual int32_t CharAt(intptr_t index) const { |
| return *CharAddr(index); |
| } |
| + virtual void SetCharAt(intptr_t index, int32_t value) const { |
| + ASSERT(value <= 0xFF); |
| + *CharAddr(index) = value; |
| + } |
| static intptr_t InstanceSize() { |
| ASSERT(sizeof(RawOneByteString) == OFFSET_OF(RawOneByteString, data_)); |
| @@ -2453,6 +2463,10 @@ class TwoByteString : public String { |
| virtual int32_t CharAt(intptr_t index) const { |
| return *CharAddr(index); |
| } |
| + virtual void SetCharAt(intptr_t index, int32_t value) const { |
| + ASSERT(value <= 0xFFFF); |
| + *CharAddr(index) = value; |
| + } |
| static intptr_t InstanceSize() { |
| ASSERT(sizeof(RawTwoByteString) == OFFSET_OF(RawTwoByteString, data_)); |
| @@ -2503,6 +2517,10 @@ class FourByteString : public String { |
| virtual int32_t CharAt(intptr_t index) const { |
| return *CharAddr(index); |
| } |
| + virtual void SetCharAt(intptr_t index, int32_t value) const { |
| + ASSERT(value <= 0x10FFFF); |
| + *CharAddr(index) = value; |
| + } |
| static intptr_t InstanceSize() { |
| ASSERT(sizeof(RawFourByteString) == OFFSET_OF(RawFourByteString, data_)); |