2020-12-26 14:12:05 -08:00
|
|
|
// Copyright (c) FIRST and other WPILib contributors.
|
|
|
|
|
// Open Source Software; you can modify and/or share it under the terms of
|
|
|
|
|
// the WPILib BSD license file in the root directory of this project.
|
2016-09-25 17:23:39 -07:00
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
#ifndef WPIUTIL_WPI_BASE64_H_
|
|
|
|
|
#define WPIUTIL_WPI_BASE64_H_
|
2016-09-25 17:23:39 -07:00
|
|
|
|
|
|
|
|
#include <cstddef>
|
|
|
|
|
#include <string>
|
|
|
|
|
|
2018-04-29 23:33:19 -07:00
|
|
|
#include "wpi/StringRef.h"
|
2016-09-25 17:23:39 -07:00
|
|
|
|
2018-04-29 23:33:19 -07:00
|
|
|
namespace wpi {
|
2017-08-13 00:55:56 -07:00
|
|
|
template <typename T>
|
|
|
|
|
class SmallVectorImpl;
|
|
|
|
|
class raw_ostream;
|
2016-09-25 17:23:39 -07:00
|
|
|
|
2018-04-29 23:33:19 -07:00
|
|
|
size_t Base64Decode(raw_ostream& os, StringRef encoded);
|
2017-08-13 00:55:56 -07:00
|
|
|
|
2018-04-29 23:33:19 -07:00
|
|
|
size_t Base64Decode(StringRef encoded, std::string* plain);
|
2017-08-13 00:55:56 -07:00
|
|
|
|
2018-04-29 23:33:19 -07:00
|
|
|
StringRef Base64Decode(StringRef encoded, size_t* num_read,
|
|
|
|
|
SmallVectorImpl<char>& buf);
|
2017-08-13 00:55:56 -07:00
|
|
|
|
2018-04-29 23:33:19 -07:00
|
|
|
void Base64Encode(raw_ostream& os, StringRef plain);
|
2017-08-13 00:55:56 -07:00
|
|
|
|
2018-04-29 23:33:19 -07:00
|
|
|
void Base64Encode(StringRef plain, std::string* encoded);
|
2016-09-25 17:23:39 -07:00
|
|
|
|
2018-04-29 23:33:19 -07:00
|
|
|
StringRef Base64Encode(StringRef plain, SmallVectorImpl<char>& buf);
|
2017-08-13 00:55:56 -07:00
|
|
|
|
2016-09-25 17:23:39 -07:00
|
|
|
} // namespace wpi
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
#endif // WPIUTIL_WPI_BASE64_H_
|