A helper class to read content from a specified input stream. This class is a high level interface added to ease testability of component that use it.
More...
#include "utils/file/reader/IReader.h"
A helper class to read content from a specified input stream. This class is a high level interface added to ease testability of component that use it.
- Note
- Copy contructor, copy-assignment operator, move constructor and move-assignment operator are defined to be compliant with the "Rule of five"
- See also
- https://en.cppreference.com/w/cpp/language/rule_of_three
- Author
- Boubacar DIENE bouba.nosp@m.car..nosp@m.diene.nosp@m.@gma.nosp@m.il.co.nosp@m.m
- Date
- May 2020
◆ IReader() [1/3]
| utils::file::IReader::IReader |
( |
| ) |
|
|
default |
◆ ~IReader()
| virtual utils::file::IReader::~IReader |
( |
| ) |
|
|
virtualdefault |
◆ IReader() [2/3]
| utils::file::IReader::IReader |
( |
const IReader & |
| ) |
|
|
delete |
◆ IReader() [3/3]
| utils::file::IReader::IReader |
( |
IReader && |
| ) |
|
|
delete |
◆ operator=() [1/2]
Class copy-assignment operator
◆ operator=() [2/2]
Class move-assignment operator
◆ readFromStream()
| virtual void utils::file::IReader::readFromStream |
( |
std::istream & |
stream, |
|
|
std::string & |
result |
|
) |
| const |
|
pure virtual |
Read the content of the provided input stream and check errors.
Note that the stream must be opened before calling this method otherwise an exception should be raised. Also, a path to a file (for example) is not used in place of stream parameter to make possible unit testing without reading from the filesystem.
- Parameters
-
| stream | The input stream where to read data from |
| result | The output variable into which the read data is stored |
Implemented in utils::file::Reader.
The documentation for this interface was generated from the following file: