| 109 | } |
| 110 | |
| 111 | static BytesView getDataBytesForKey(const Value& value, std::string_view stringKey, std::string_view base64Key) { |
| 112 | auto stringValue = value.getMapValue(stringKey); |
| 113 | if (stringValue.isString()) { |
| 114 | auto str = stringValue.toStringBox(); |
| 115 | return BytesView(str.getInternedString(), reinterpret_cast<const Byte*>(str.getCStr()), str.length()); |
| 116 | } |
| 117 | |
| 118 | auto base64String = value.getMapValue(base64Key).toStringBox(); |
| 119 | auto data = makeShared<Bytes>(); |
| 120 | snap::utils::encoding::base64ToBinary(base64String.toStringView(), *data); |
| 121 | return BytesView(data); |
| 122 | } |
| 123 | |
| 124 | void DaemonClient::processEvent(const Value& event) { |
| 125 | auto updatedResources = event.getMapValue("updated_resources"); |
no test coverage detected