A non-owning reference to a mutable range of memory. Use with caution :)
| 63 | //! A non-owning reference to a mutable range of memory. |
| 64 | //! Use with caution :) |
| 65 | class TMutableRef |
| 66 | : public TMutableRange<char> |
| 67 | { |
| 68 | public: |
| 69 | //! Creates a null TMutableRef. |
| 70 | //! Note empty TMutableRef is not the same as null TMutableRef. |
| 71 | //! `operator bool` can be used to check if ref is nonnull. |
| 72 | TMutableRef() = default; |
| 73 | |
| 74 | //! Creates a TMutableRef for a given block of memory. |
| 75 | TMutableRef(void* data, size_t size); |
| 76 | |
| 77 | //! Creates a TMutableRef for a given range of memory. |
| 78 | TMutableRef(void* begin, void* end); |
| 79 | |
| 80 | //! Creates an empty TMutableRef. |
| 81 | static TMutableRef MakeEmpty(); |
| 82 | |
| 83 | //! Converts a TMutableRef to TRef. |
| 84 | operator TRef() const; |
| 85 | |
| 86 | //! Creates a non-owning TMutableRef for a given blob. |
| 87 | static TMutableRef FromBlob(TBlob& blob); |
| 88 | |
| 89 | //! Creates a non-owning TMutableRef for a given pod structure. |
| 90 | template <class T> |
| 91 | static TMutableRef FromPod(T& data); |
| 92 | |
| 93 | //! Creates a non-owning TMutableRef for a given TString. |
| 94 | //! Ensures that the string is not shared. |
| 95 | static TMutableRef FromString(TString& str); |
| 96 | |
| 97 | //! Creates a non-owning TMutableRef for a given std::string. |
| 98 | static TMutableRef FromString(std::string& str); |
| 99 | |
| 100 | //! Creates a TMutableRef for a part of existing range. |
| 101 | TMutableRef Slice(size_t startOffset, size_t endOffset) const; |
| 102 | }; |
| 103 | |
| 104 | //////////////////////////////////////////////////////////////////////////////// |
| 105 |
no outgoing calls
no test coverage detected