| 892 | } |
| 893 | |
| 894 | void XPathIo::ReadDataUri(const std::string& path) { |
| 895 | size_t base64Pos = path.find("base64,"); |
| 896 | if (base64Pos == std::string::npos) |
| 897 | throw Error(ErrorCode::kerErrorMessage, "No base64 data"); |
| 898 | |
| 899 | std::string data = path.substr(base64Pos + 7); |
| 900 | auto decodeData = new char[data.length()]; |
| 901 | auto size = base64decode(data.c_str(), decodeData, data.length()); |
| 902 | if (size > 0) |
| 903 | write((byte*)decodeData, size); |
| 904 | else |
| 905 | throw Error(ErrorCode::kerErrorMessage, "Unable to decode base 64."); |
| 906 | delete[] decodeData; |
| 907 | } |
| 908 | |
| 909 | #elif defined(EXV_ENABLE_FILESYSTEM) |
| 910 | XPathIo::XPathIo(const std::string& orgPath) : FileIo(XPathIo::writeDataToFile(orgPath)), tempFilePath_(path()) { |
nothing calls this directly
no test coverage detected