74 size_t _pushed_in_bytes = 0;
76 virtual bool vOnPush( u8 x_ ){
87 bool Push(
const std::string& str_) {
89 for(
auto it : str_ ){
94 return failed ? false :
true;
104 bool result = vOnPush(x_);
105 if (result) ++_pushed_in_bytes;
110 size_t _poped_in_bytes = 0;
112 virtual bool vOnPop(u8& x_) {
123 _poped_in_bytes = offset_;
133 const bool result = vOnPop(x_);
134 if (result) ++_poped_in_bytes;
158 bool vOnPop(u8& x_)
override {
159 if (_poped_in_bytes < _bytesize) {
160 x_ = *(_addr + _poped_in_bytes);
184 _bytesize(bytesize_) {}
192 std::vector<u8> _buff;
208 bool vOnPush(u8 x_)
override {
213 bool vOnPop(u8& x_)
override {
214 if (_poped_in_bytes < _buff.size()) {
215 x_ = _buff[_poped_in_bytes];
228 bool vOnPush(u8 x_)
override {
233 bool vOnPop(u8& x_)
override {
262 std::shared_ptr< Pipe::CPipe > pipe_in_,
263 std::shared_ptr< Pipe::CPipe > pipe_out_
A file pipe class that reads and writes data to a file.
Definition pipe.h:225
CFilePipe(FILE *fp_)
Constructs a file pipe.
Definition pipe.h:248
A memory buffer pipe class that holds data in a buffer.
Definition pipe.h:190
void Dump()
Dumps the contents of the memory buffer.
Definition pipe.cpp:9
size_t Size() const
Gets the size of the memory buffer.
Definition pipe.h:204
A memory reader pipe class that reads data from a memory buffer.
Definition pipe.h:154
CMemReaderPipe(const u8 *addr_, size_t bytesize_)
Constructs a memory reader pipe.
Definition pipe.h:182
size_t Size() const
Gets the size of the memory buffer.
Definition pipe.h:172
A null pipe class that does nothing.
Definition pipe.h:145
Base class for all pipe implementations.
Definition pipe.h:72
void SeekPop(size_t offset_=0)
Sets the position for the next Pop operation.
Definition pipe.h:122
bool Push(u8 x_)
Pushes a byte of data into the pipe.
Definition pipe.h:103
bool Pop(u8 &x_)
Pops a byte of data from the pipe.
Definition pipe.h:132
bool Push(const std::string &str_)
Pushes a string of data into the pipe.
Definition pipe.h:87