mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-15 15:16:12 -04:00
Signed-off-by: Alexey Polyudov <apolyudov@google.com> Change-Id: I2cf5bf225b76f4c1541954651f3a7544a14e0cec
32 lines
824 B
C++
32 lines
824 B
C++
#ifndef PLATFORM_BASE64_UTILS_H_
|
|
#define PLATFORM_BASE64_UTILS_H_
|
|
|
|
#include "platform/byte_array.h"
|
|
#include "platform/port/string.h"
|
|
#include "platform/ptr.h"
|
|
|
|
namespace location {
|
|
namespace nearby {
|
|
|
|
class Base64Utils {
|
|
public:
|
|
static std::string encode(const std::string& input);
|
|
static std::string encode(const ByteArray& bytes);
|
|
static std::string encode(ConstPtr<ByteArray> bytes);
|
|
|
|
template <typename T>
|
|
static T decode(const std::string& base64_string);
|
|
template <>
|
|
Ptr<ByteArray> decode(const std::string& base64_string);
|
|
template <>
|
|
ByteArray decode(const std::string& base64_string);
|
|
static Ptr<ByteArray> decode(const std::string& base64_string) {
|
|
return decode<Ptr<ByteArray>>(base64_string);
|
|
}
|
|
};
|
|
|
|
} // namespace nearby
|
|
} // namespace location
|
|
|
|
#endif // PLATFORM_BASE64_UTILS_H_
|