| 234 | }; |
| 235 | |
| 236 | class String : public Sized { |
| 237 | public: |
| 238 | // Size prefix. |
| 239 | String(const uint8_t *data, uint8_t byte_width) : Sized(data, byte_width) {} |
| 240 | // Manual size. |
| 241 | String(const uint8_t *data, uint8_t byte_width, size_t sz) |
| 242 | : Sized(data, byte_width, sz) {} |
| 243 | |
| 244 | size_t length() const { return size(); } |
| 245 | const char *c_str() const { return reinterpret_cast<const char *>(data_); } |
| 246 | std::string str() const { return std::string(c_str(), size()); } |
| 247 | |
| 248 | static String EmptyString() { |
| 249 | static const char *empty_string = ""; |
| 250 | return String(reinterpret_cast<const uint8_t *>(empty_string), 1, 0); |
| 251 | } |
| 252 | bool IsTheEmptyString() const { return data_ == EmptyString().data_; } |
| 253 | }; |
| 254 | |
| 255 | class Blob : public Sized { |
| 256 | public: |
nothing calls this directly
no outgoing calls
no test coverage detected