1//========================================================================
2//
3// gbase64.h
4//
5// Implementation of a base64 encoder, because another one did not immediately
6// avail itself.
7//
8// This file is licensed under the GPLv2 or later
9//
10// Copyright (C) 2018 Greg Knight <lyngvi@gmail.com>
11// Copyright (C) 2019 Albert Astals Cid <aacid@kde.org>
12//
13//========================================================================
14
15#ifndef GOO_GBASE64_H
16#define GOO_GBASE64_H
17
18#include "poppler_private_export.h"
19
20#include <string>
21#include <vector>
22
23std::string POPPLER_PRIVATE_EXPORT gbase64Encode(const void *input, size_t len);
24
25inline std::string gbase64Encode(const std::vector<char> &input)
26{
27 return input.empty() ? std::string() : gbase64Encode(input: &input[0], len: input.size());
28}
29
30inline std::string gbase64Encode(const std::vector<unsigned char> &input)
31{
32 return input.empty() ? std::string() : gbase64Encode(input: &input[0], len: input.size());
33}
34
35#endif // ndef GOO_GBASE64_H
36

source code of poppler/goo/gbase64.h