| 370 | |
| 371 | template<typename T> |
| 372 | T value(const std::string& type, const std::string& value) |
| 373 | { |
| 374 | if (type == "base64Binary") |
| 375 | { |
| 376 | std::vector<uint8_t> encVal = Utils::base64_decode(value); |
| 377 | encVal.resize(sizeof(T)); |
| 378 | return *(reinterpret_cast<T *>(encVal.data())); |
| 379 | } |
| 380 | |
| 381 | T t{}; |
| 382 | if (!Utils::fromString(value, t)) |
| 383 | throw value_error(); |
| 384 | return t; |
| 385 | } |
| 386 | |
| 387 | template<> |
| 388 | inline bool value(const std::string& type, const std::string& value) |
no test coverage detected