A helper class to write a given value to a specified output stream. This class is a high level interface added to ease testability of component that use it.
More...
#include "utils/file/writer/IWriter.h"
A helper class to write a given value to a specified output 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
◆ IWriter() [1/3]
| utils::file::IWriter::IWriter |
( |
| ) |
|
|
default |
◆ ~IWriter()
| virtual utils::file::IWriter::~IWriter |
( |
| ) |
|
|
virtualdefault |
◆ IWriter() [2/3]
| utils::file::IWriter::IWriter |
( |
const IWriter & |
| ) |
|
|
delete |
◆ IWriter() [3/3]
| utils::file::IWriter::IWriter |
( |
IWriter && |
| ) |
|
|
delete |
◆ operator=() [1/2]
Class copy-assignment operator
◆ operator=() [2/2]
Class move-assignment operator
◆ writeToStream()
| virtual void utils::file::IWriter::writeToStream |
( |
std::ostream & |
stream, |
|
|
const std::string & |
value |
|
) |
| const |
|
pure virtual |
Write the given value to the provided output 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 writing to the filesystem.
- Parameters
-
| stream | The output stream where to write the value |
| value | The new value that will replace the currrent content |
Implemented in utils::file::Writer.
The documentation for this interface was generated from the following file: