ProteoWizard
pwiz
utility
misc
Base64.hpp
Go to the documentation of this file.
1
//
2
// $Id$
3
//
4
//
5
// Original author: Darren Kessner <darren@proteowizard.org>
6
//
7
// Copyright 2005 Louis Warschaw Prostate Cancer Center
8
// Cedars Sinai Medical Center, Los Angeles, California 90048
9
//
10
// Licensed under the Apache License, Version 2.0 (the "License");
11
// you may not use this file except in compliance with the License.
12
// You may obtain a copy of the License at
13
//
14
// http://www.apache.org/licenses/LICENSE-2.0
15
//
16
// Unless required by applicable law or agreed to in writing, software
17
// distributed under the License is distributed on an "AS IS" BASIS,
18
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
// See the License for the specific language governing permissions and
20
// limitations under the License.
21
//
22
23
24
#ifndef _BASE64_HPP_
25
#define _BASE64_HPP_
26
27
#include "
pwiz/utility/misc/Export.hpp
"
28
#include <cstddef>
// for size_t
29
30
31
namespace
pwiz
{
32
namespace
util {
33
34
35
/// Base-64 binary->text encoding
36
/// (maps 3 bytes <-> 4 chars)
37
namespace
Base64
38
{
39
/// Returns buffer size required by binary->text conversion.
40
PWIZ_API_DECL
size_t
binaryToTextSize
(
size_t
byteCount);
41
42
/// binary -> text conversion
43
/// - Caller must allocate buffer
44
/// - Buffer will not be null-terminated
45
/// - Returns the actual number of bytes written
46
PWIZ_API_DECL
size_t
binaryToText
(
const
void
* from,
size_t
byteCount,
char
* to);
47
48
/// Returns sufficient buffer size for text->binary conversion.
49
PWIZ_API_DECL
size_t
textToBinarySize
(
size_t
charCount);
50
51
/// text -> binary conversion
52
/// - Caller must allocate buffer
53
/// - Buffer will not be null-terminated
54
/// - Returns the actual number of bytes written
55
PWIZ_API_DECL
size_t
textToBinary
(
const
char
* from,
size_t
charCount,
void
* to);
56
57
}
// namespace Base64
58
59
60
}
// namespace util
61
}
// namespace pwiz
62
63
64
#endif // _BASE64_HPP_
65
pwiz::util::Base64::binaryToText
PWIZ_API_DECL size_t binaryToText(const void *from, size_t byteCount, char *to)
binary -> text conversion
pwiz
Definition:
ChromatogramList_Filter.hpp:36
pwiz::util::Base64::textToBinary
PWIZ_API_DECL size_t textToBinary(const char *from, size_t charCount, void *to)
text -> binary conversion
PWIZ_API_DECL
#define PWIZ_API_DECL
Definition:
Export.hpp:32
Export.hpp
pwiz::util::Base64::textToBinarySize
PWIZ_API_DECL size_t textToBinarySize(size_t charCount)
Returns sufficient buffer size for text->binary conversion.
pwiz::util::Base64::binaryToTextSize
PWIZ_API_DECL size_t binaryToTextSize(size_t byteCount)
Returns buffer size required by binary->text conversion.
Generated by
1.8.17