OpenShot Library | libopenshot-audio  0.2.0
juce_Base64.h
1 
2 /** @weakgroup juce_core-text
3  * @{
4  */
5 /*
6  ==============================================================================
7 
8  This file is part of the JUCE library.
9  Copyright (c) 2017 - ROLI Ltd.
10 
11  JUCE is an open source library subject to commercial or open-source
12  licensing.
13 
14  The code included in this file is provided under the terms of the ISC license
15  http://www.isc.org/downloads/software-support-policy/isc-license. Permission
16  To use, copy, modify, and/or distribute this software for any purpose with or
17  without fee is hereby granted provided that the above copyright notice and
18  this permission notice appear in all copies.
19 
20  JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
21  EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
22  DISCLAIMED.
23 
24  ==============================================================================
25 */
26 
27 namespace juce
28 {
29 
30 /**
31  Contains some static methods for converting between binary and the
32  standard base-64 encoding format.
33 
34  @tags{Core}
35 */
37 {
38  /** Converts a binary block of data into a base-64 string.
39  This will write the resulting string data to the given stream.
40  If a write error occurs with the stream, the method will terminate and return false.
41  */
42  static bool convertToBase64 (OutputStream& base64Result, const void* sourceData, size_t sourceDataSize);
43 
44  /** Converts a base-64 string back to its binary representation.
45  This will write the decoded binary data to the given stream.
46  If the string is not valid base-64, the method will terminate and return false.
47  */
48  static bool convertFromBase64 (OutputStream& binaryOutput, StringRef base64TextInput);
49 
50  /** Converts a block of binary data to a base-64 string. */
51  static String toBase64 (const void* sourceData, size_t sourceDataSize);
52 
53  /** Converts a string's UTF-8 representation to a base-64 string. */
54  static String toBase64 (const String& textToEncode);
55 };
56 
57 } // namespace juce
58 
59 /** @}*/
#define JUCE_API
This macro is added to all JUCE public class declarations.
A simple class for holding temporary references to a string literal or String.
The JUCE String class!
Definition: juce_String.h:42
The base class for streams that write data to some kind of destination.
Contains some static methods for converting between binary and the standard base-64 encoding format...
Definition: juce_Base64.h:36