MultiStream.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  * MultiStream.h
8  *
9  * Created on: Nov 7, 2018
10  * Author: slavey
11  *
12  ****/
13 
14 #pragma once
15 
16 #include "DataSourceStream.h"
17 #include <memory>
18 
24 {
25 public:
26  uint16_t readMemoryBlock(char* data, int bufSize) override;
27 
28  bool seek(int len) override;
29 
30  bool isFinished() override
31  {
32  return finished;
33  }
34 
35 protected:
42 
43 private:
44  std::unique_ptr<IDataSourceStream> stream;
45  bool finished{false};
46 };
Base class for read-only stream.
Definition: DataSourceStream.h:45
virtual IDataSourceStream * getNextStream()=0
Inherited class must implement this.
bool seek(int len) override
Move read cursor.
bool isFinished() override
Check if all data has been read.
Definition: MultiStream.h:41
Base class for read-only stream which generates output from multiple source streams.
Definition: MultiStream.h:23
uint16_t readMemoryBlock(char *data, int bufSize) override
Read a block of memory.