Files
nearby/cpp/platform/base64_utils.h
T
Alexey Polyudov 204f76077d nearby: snapshot as of cl/296436629
Signed-off-by: Alexey Polyudov <apolyudov@google.com>
Change-Id: I2cf5bf225b76f4c1541954651f3a7544a14e0cec
2020-04-04 12:52:31 -07:00

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_