mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 07:36:10 -04:00
nearby: snapshot as of cl/296436629
Signed-off-by: Alexey Polyudov <apolyudov@google.com> Change-Id: I2cf5bf225b76f4c1541954651f3a7544a14e0cec
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#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_
|
||||
Reference in New Issue
Block a user