Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
Base64OutputStream.h
1 /****
2  * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
3  * Created 2015 by Skurydin Alexey
4  * http://github.com/SmingHub/Sming
5  * All files of the Sming Core are provided under the LGPL v3 license.
6  *
7  * Base64OutputStream.h
8  *
9  * @author Slavey Karadzhov <slaff@attachix.com>
10  *
11  ****/
12 
13 #ifndef _SMING_CORE_DATA_STREAM_BASE64_OUTPUT_STREAM_H_
14 #define _SMING_CORE_DATA_STREAM_BASE64_OUTPUT_STREAM_H_
15 
16 #include "../StreamTransformer.h"
17 #include "../Services/libb64/cencode.h"
18 
27 {
28 public:
34  Base64OutputStream(IDataSourceStream* stream, size_t resultSize = 500);
35 
36  size_t transform(const uint8_t* source, size_t sourceLength, uint8_t* target, size_t targetLength) override;
37 
41  void saveState() override;
42 
46  void restoreState() override;
47 
48 private:
49  base64_encodestate state;
50  base64_encodestate lastState;
51 };
52 
54 #endif /* _SMING_CORE_DATA_STREAM_BASE64_OUTPUT_STREAM_H_ */
Base class for data source stream.
Definition: DataSourceStream.h:39
void restoreState() override
A method that restores the last backed up state.
Definition: StreamTransformer.h:32
Base64 Stream.
Definition: Base64OutputStream.h:26
void saveState() override
A method that backs up the current state.
Base64OutputStream(IDataSourceStream *stream, size_t resultSize=500)
Stream that transforms bytes of data into base64 data stream.
Definition: cencode.h:20
size_t transform(const uint8_t *source, size_t sourceLength, uint8_t *target, size_t targetLength) override
Inherited class implements this method to transform a block of data.