WPILibC++ 2025.2.1
Loading...
Searching...
No Matches
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
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
48
49#endif // WPIUTIL_WPI_BASE64_H_
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition sha1.h:30
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:43
Foonathan namespace.
Definition ntcore_cpp.h:26
void Base64Encode(raw_ostream &os, std::string_view plain)
size_t Base64Decode(raw_ostream &os, std::string_view encoded)