| 634 | |
| 635 | #ifdef JSONCPP_HAS_STRING_VIEW |
| 636 | ErrorCode Value::get(std::string_view& view) const { |
| 637 | if (type() != stringValue) |
| 638 | return INCORRECT_TYPE; |
| 639 | if (value_.string_ == nullptr) |
| 640 | return UNINITIALIZED; |
| 641 | const char* begin; |
| 642 | unsigned length; |
| 643 | decodePrefixedString(this->isAllocated(), this->value_.string_, &length, &begin); |
| 644 | view = std::string_view(begin, length); |
| 645 | return SUCCESS; |
| 646 | } |
| 647 | #endif |
| 648 | |
| 649 | StringContainer Value::asString() const { |
no test coverage detected