WPILibC++ 2024.3.2
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 <stdint.h>
9
10#include <cstddef>
11#include <span>
12#include <string>
13#include <string_view>
14#include <vector>
15
16namespace wpi {
17template <typename T>
18class SmallVectorImpl;
19class raw_ostream;
20
22
23size_t Base64Decode(std::string_view encoded, std::string* plain);
24
27
28size_t Base64Decode(std::string_view encoded, std::vector<uint8_t>* plain);
29
30std::span<uint8_t> Base64Decode(std::string_view encoded, size_t* num_read,
32
34
35void Base64Encode(std::string_view plain, std::string* encoded);
36
39
40void Base64Encode(raw_ostream& os, std::span<const uint8_t> plain);
41
42void Base64Encode(std::span<const uint8_t> plain, std::string* encoded);
43
44std::string_view Base64Encode(std::span<const uint8_t> plain,
46
47} // namespace wpi
48
49#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:43
basic_string_view< char > string_view
Definition: core.h:501
Definition: ntcore_cpp.h:26
void Base64Encode(raw_ostream &os, std::string_view plain)
size_t Base64Decode(raw_ostream &os, std::string_view encoded)