Note: StringHandle is a union member in ExpressionValue, therefore it must be no larger than 32 bits and it cannot have a non-trivial destructor, copy constructor etc. This means that when an object containing a StringHandle is copied or destroyed, that object must handle the reference count. Classes other than ExpressionValue should use AutoStringHandle instead;
| 15 | // This means that when an object containing a StringHandle is copied or destroyed, that object must handle the reference count. |
| 16 | // Classes other than ExpressionValue should use AutoStringHandle instead; |
| 17 | class StringHandle |
| 18 | { |
| 19 | public: |
| 20 | StringHandle() noexcept { slotPtr = nullptr; } |
| 21 | explicit StringHandle(const char *_ecv_array s) noexcept; |
| 22 | StringHandle(const char *_ecv_array s, size_t len) noexcept; |
| 23 | |
| 24 | #if 0 // unused |
| 25 | StringHandle(const char *_ecv_array s1, const char *_ecv_array s2) noexcept; |
| 26 | #endif |
| 27 | |
| 28 | ReadLockedPointer<const char> Get() const noexcept; |
| 29 | size_t GetLength() const noexcept; |
| 30 | void Delete() noexcept; |
| 31 | const StringHandle& IncreaseRefCount() const noexcept; |
| 32 | bool IsNull() const noexcept { return slotPtr == nullptr; } |
| 33 | void Assign(const char *_ecv_array s) noexcept; |
| 34 | |
| 35 | protected: |
| 36 | void InternalAssign(const char *_ecv_array s, size_t len) noexcept; |
| 37 | |
| 38 | Heap::IndexSlot * null slotPtr; |
| 39 | }; |
| 40 | |
| 41 | // Version of StringHandle that updates the reference counts automatically |
| 42 | class AutoStringHandle : public StringHandle |
no outgoing calls
no test coverage detected