Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
UrlencodedOutputStream.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  * UrlencodedOutputStream.h
8  *
9  * @author Slavey Karadzhov <slaff@attachix.com>
10  *
11  ****/
12 
13 #ifndef _SMING_CORE_DATA_URL_ENCODDED_OUTPUT_STREAM_H_
14 #define _SMING_CORE_DATA_URL_ENCODDED_OUTPUT_STREAM_H_
15 
16 #include "MemoryDataStream.h"
17 #include "Network/Http/HttpParams.h"
18 
27 {
28 public:
33  UrlencodedOutputStream(const HttpParams& params);
34 
35  //Use base class documentation
36  StreamType getStreamType() const override
37  {
38  return stream.getStreamType();
39  }
40 
45  int available() override
46  {
47  return stream.available();
48  }
49 
50  //Use base class documentation
51  uint16_t readMemoryBlock(char* data, int bufSize) override
52  {
53  return stream.readMemoryBlock(data, bufSize);
54  }
55 
56  //Use base class documentation
57  bool seek(int len) override
58  {
59  return stream.seek(len);
60  }
61 
62  //Use base class documentation
63  bool isFinished() override
64  {
65  return stream.isFinished();
66  }
67 
68 private:
69  MemoryDataStream stream;
70 };
71 
73 #endif /* _SMING_CORE_DATA_URL_ENCODDED_OUTPUT_STREAM_H_ */
int available() override
Return the total length of the stream.
Definition: UrlencodedOutputStream.h:45
bool isFinished() override
Check if all data has been read.
Definition: MemoryDataStream.h:76
Definition: HttpParams.h:32
Base class for data source stream.
Definition: DataSourceStream.h:39
UrlEncoded Stream.
Definition: UrlencodedOutputStream.h:26
uint16_t readMemoryBlock(char *data, int bufSize) override
Read a block of memory.
Definition: UrlencodedOutputStream.h:51
int available() override
Return the total length of the stream.
Definition: MemoryDataStream.h:55
bool seek(int len) override
Move read cursor.
Definition: UrlencodedOutputStream.h:57
StreamType getStreamType() const override
Get the stream type.
Definition: UrlencodedOutputStream.h:36
bool seek(int len) override
Move read cursor.
StreamType
Data stream type.
Definition: DataSourceStream.h:22
uint16_t readMemoryBlock(char *data, int bufSize) override
Read a block of memory.
UrlencodedOutputStream(const HttpParams &params)
Represents key-value pairs as urlencoded string.
bool isFinished() override
Check if all data has been read.
Definition: UrlencodedOutputStream.h:63
StreamType getStreamType() const override
Get the stream type.
Definition: MemoryDataStream.h:38
Definition: MemoryDataStream.h:29