1 #ifndef DYNAMIC_DEPTH_INTERNAL_XMPMETA_BASE64_H_ // NOLINT 2 #define DYNAMIC_DEPTH_INTERNAL_XMPMETA_BASE64_H_ // NOLINT 3 4 #include <iostream> 5 #include <string> 6 #include <vector> 7 8 #include "base/port.h" 9 10 namespace dynamic_depth { 11 namespace xmpmeta { 12 // Decodes the base64-encoded input range. Supports decoding of both web-safe 13 // and regular base64."Web-safe" base-64 replaces + with - and / with _, and 14 // omits trailing = padding characters. 15 bool DecodeBase64(const string& data, string* output); 16 17 // Base64-encodes the given string. 18 bool EncodeBase64(const string& data, string* output); 19 20 // Base64-encodes the given int array. 21 bool EncodeIntArrayBase64(const std::vector<int32_t>& data, string* output); 22 23 // Base64-decodes the given int array. 24 bool DecodeIntArrayBase64(const string& data, std::vector<int32_t>* output); 25 26 // Base64-encodes the given float array. 27 bool EncodeFloatArrayBase64(const std::vector<float>& data, string* output); 28 29 // Base64-decodes the given float array. 30 bool DecodeFloatArrayBase64(const string& data, std::vector<float>* output); 31 32 // Base64-encodes the given double array. 33 bool EncodeDoubleArrayBase64(const std::vector<double>& data, string* output); 34 35 // Base64-decodes the given double array. 36 bool DecodeDoubleArrayBase64(const string& data, std::vector<double>* output); 37 38 } // namespace xmpmeta 39 } // namespace dynamic_depth 40 41 #endif // DYNAMIC_DEPTH_INTERNAL_XMPMETA_BASE64_H_ // NOLINT 42