| 45 | } |
| 46 | |
| 47 | void MSNumpressCoder::decodeNP(const String & in, std::vector<double> & out, |
| 48 | bool zlib_compression, const NumpressConfig & config) |
| 49 | { |
| 50 | QByteArray base64_uncompressed; |
| 51 | Base64::decodeSingleString(in, base64_uncompressed, zlib_compression); |
| 52 | |
| 53 | // Create a temporary string (*not* null-terminated) to hold the data |
| 54 | std::string tmpstring(base64_uncompressed.constData(), base64_uncompressed.size()); |
| 55 | decodeNPRaw(tmpstring, out, config); |
| 56 | |
| 57 | // NOTE: it is possible (and likely faster) to call directly the const |
| 58 | // unsigned char * function but this would make it necessary to deal with |
| 59 | // reinterpret_cast ugliness here ... |
| 60 | // |
| 61 | // decodeNP_internal_(reinterpret_cast<const unsigned char*>(base64_uncompressed.constData()), base64_uncompressed.size(), out, config); |
| 62 | } |
| 63 | |
| 64 | void MSNumpressCoder::encodeNPRaw(const std::vector<double>& in, String& result, const NumpressConfig & config) |
| 65 | { |