| 82 | return readString(); |
| 83 | } |
| 84 | std::string readValue() |
| 85 | { |
| 86 | switch(nextType()) |
| 87 | { |
| 88 | case MajorType::ByteString: |
| 89 | return util::toHex(readBytes(readLength())); |
| 90 | case MajorType::TextString: |
| 91 | return readString(); |
| 92 | case MajorType::SimpleData: |
| 93 | { |
| 94 | unsigned value = nextImmediate(); |
| 95 | m_pos++; |
| 96 | if (value == 20) |
| 97 | return "false"; |
| 98 | if (value == 21) |
| 99 | return "true"; |
| 100 | solUnimplemented("Unsupported simple value (not a boolean)."); |
| 101 | } |
| 102 | case MajorType::Map: |
| 103 | solUnimplemented("Nested maps not supported."); |
| 104 | } |
| 105 | util::unreachable(); |
| 106 | } |
| 107 | private: |
| 108 | enum class MajorType |
| 109 | { |
no test coverage detected