| 155 | }; |
| 156 | |
| 157 | struct FixedString : public FixedStringBase |
| 158 | { |
| 159 | inline FixedString() |
| 160 | : FixedStringBase() |
| 161 | {} |
| 162 | |
| 163 | explicit FixedString(StringView str); |
| 164 | explicit FixedString(char const* str); |
| 165 | explicit FixedString(nullptr_t); |
| 166 | |
| 167 | inline FixedString(FixedString const& fs) |
| 168 | : FixedStringBase(fs.Index) |
| 169 | { |
| 170 | IncRef(); |
| 171 | } |
| 172 | |
| 173 | inline FixedString(FixedStringBase const& fs) |
| 174 | : FixedStringBase(fs.Index) |
| 175 | { |
| 176 | IncRef(); |
| 177 | } |
| 178 | |
| 179 | inline FixedString(FixedString&& fs) noexcept |
| 180 | : FixedStringBase(fs.Index) |
| 181 | { |
| 182 | fs.Index = NullIndex; |
| 183 | } |
| 184 | |
| 185 | inline ~FixedString() |
| 186 | { |
| 187 | DecRef(); |
| 188 | } |
| 189 | |
| 190 | inline FixedString& operator = (FixedString const& fs) |
| 191 | { |
| 192 | if (fs.Index != Index) { |
| 193 | DecRef(); |
| 194 | Index = fs.Index; |
| 195 | IncRef(); |
| 196 | } |
| 197 | |
| 198 | return *this; |
| 199 | } |
| 200 | |
| 201 | inline FixedString& operator = (FixedString&& fs) noexcept |
| 202 | { |
| 203 | Index = fs.Index; |
| 204 | if (this != &fs) { |
| 205 | fs.Index = NullIndex; |
| 206 | } |
| 207 | |
| 208 | return *this; |
| 209 | } |
| 210 | |
| 211 | inline bool operator == (FixedString const& fs) const |
| 212 | { |
| 213 | return Index == fs.Index; |
| 214 | } |
no outgoing calls
no test coverage detected