2016-09-25 17:23:39 -07:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2018-01-01 17:32:39 -08:00
|
|
|
/* Copyright (c) 2015-2018 FIRST. All Rights Reserved. */
|
2016-09-25 17:23:39 -07:00
|
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
|
|
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
|
|
|
/* the project. */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
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_
|