UrlencodedOutputStream.h
Go to the documentation of this file.
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 #pragma once
14 
17 
23 {
24 public:
26 
27  StreamType getStreamType() const override
28  {
29  return stream.getStreamType();
30  }
31 
32  int available() override
33  {
34  return stream.available();
35  }
36 
37  uint16_t readMemoryBlock(char* data, int bufSize) override
38  {
39  return stream.readMemoryBlock(data, bufSize);
40  }
41 
42  bool seek(int len) override
43  {
44  return stream.seek(len);
45  }
46 
47  bool isFinished() override
48  {
49  return stream.isFinished();
50  }
51 
52 private:
53  MemoryDataStream stream;
54 };
Handles the query portion of a URI.
Definition: HttpParams.h:35
Base class for read-only stream.
Definition: DataSourceStream.h:46
virtual bool seek(int len)
Move read cursor.
Definition: DataSourceStream.h:106
Read/write stream using expandable memory buffer.
Definition: MemoryDataStream.h:27
uint16_t readMemoryBlock(char *data, int bufSize) override
Read a block of memory.
int available() override
Return the total length of the stream.
Definition: MemoryDataStream.h:60
bool isFinished() override
Check if all data has been read.
Definition: MemoryDataStream.h:78
StreamType getStreamType() const override
Get the stream type.
Definition: MemoryDataStream.h:43
Represents key-value pairs as urlencoded string content.
Definition: UrlencodedOutputStream.h:23
uint16_t readMemoryBlock(char *data, int bufSize) override
Read a block of memory.
Definition: UrlencodedOutputStream.h:37
bool seek(int len) override
Move read cursor.
Definition: UrlencodedOutputStream.h:42
StreamType getStreamType() const override
Get the stream type.
Definition: UrlencodedOutputStream.h:27
UrlencodedOutputStream(const HttpParams &params)
int available() override
Return the total length of the stream.
Definition: UrlencodedOutputStream.h:32
bool isFinished() override
Check if all data has been read.
Definition: UrlencodedOutputStream.h:47
StreamType
Data stream type.
Definition: DataSourceStream.h:25