WPILibC++ 2023.4.3
Base64.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#ifndef WPIUTIL_WPI_BASE64_H_
6#define WPIUTIL_WPI_BASE64_H_
7
8#include <cstddef>
9#include <span>
10#include <string>
11#include <string_view>
12#include <vector>
13
14namespace wpi {
15template <typename T>
16class SmallVectorImpl;
17class raw_ostream;
18
20
21size_t Base64Decode(std::string_view encoded, std::string* plain);
22
25
26size_t Base64Decode(std::string_view encoded, std::vector<uint8_t>* plain);
27
28std::span<uint8_t> Base64Decode(std::string_view encoded, size_t* num_read,
30
32
33void Base64Encode(std::string_view plain, std::string* encoded);
34
37
38void Base64Encode(raw_ostream& os, std::span<const uint8_t> plain);
39
40void Base64Encode(std::span<const uint8_t> plain, std::string* encoded);
41
42std::string_view Base64Encode(std::span<const uint8_t> plain,
44
45} // namespace wpi
46
47#endif // WPIUTIL_WPI_BASE64_H_
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:44
basic_string_view< char > string_view
Definition: core.h:520
/file This file defines the SmallVector class.
Definition: AprilTagFieldLayout.h:18
void Base64Encode(raw_ostream &os, std::string_view plain)
size_t Base64Decode(raw_ostream &os, std::string_view encoded)