-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathgbase64.h
35 lines (28 loc) · 979 Bytes
/
gbase64.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//========================================================================
//
// gbase64.h
//
// Implementation of a base64 encoder, because another one did not immediately
// avail itself.
//
// This file is licensed under the GPLv2 or later
//
// Copyright (C) 2018 Greg Knight <[email protected]>
// Copyright (C) 2019 Albert Astals Cid <[email protected]>
//
//========================================================================
#ifndef GOO_GBASE64_H
#define GOO_GBASE64_H
#include "poppler_private_export.h"
#include <string>
#include <vector>
std::string POPPLER_PRIVATE_EXPORT gbase64Encode(const void *input, size_t len);
inline std::string gbase64Encode(const std::vector<char> &input)
{
return input.empty() ? std::string() : gbase64Encode(&input[0], input.size());
}
inline std::string gbase64Encode(const std::vector<unsigned char> &input)
{
return input.empty() ? std::string() : gbase64Encode(&input[0], input.size());
}
#endif // ndef GOO_GBASE64_H