WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
Base64.hpp
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#pragma once
6
7#include <stdint.h>
8
9#include <cstddef>
10#include <span>
11#include <string>
12#include <string_view>
13#include <vector>
14
15namespace wpi::util {
16
17template <typename T>
18class SmallVectorImpl;
19class raw_ostream;
20
21size_t Base64Decode(raw_ostream& os, std::string_view encoded);
22
23size_t Base64Decode(std::string_view encoded, std::string* plain);
24
25std::string_view Base64Decode(std::string_view encoded, size_t* num_read,
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
33void Base64Encode(raw_ostream& os, std::string_view plain);
34
35void Base64Encode(std::string_view plain, std::string* encoded);
36
37std::string_view Base64Encode(std::string_view plain,
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::util
Definition BooleanTopic.hpp:24
Definition raw_os_ostream.hpp:19
size_t Base64Decode(raw_ostream &os, std::string_view encoded)
void Base64Encode(raw_ostream &os, std::string_view plain)