|
GEOS
|
This class implements pipe redirection to allow to capture and process externally streamed messages. More...
#include <ExternalErrorHandler.hpp>
Public Types | |
| using | PosixId = int |
| Posix identifier, can be a file handle, an error number... Must be consistent with posix functions. | |
| using | LineHandlingFunctor = std::function< void(std::string_view, std::string_view) > |
| A functor executed for each independant lines to process, taking the line as the 1st string_view parameter, and the detectionLocation as the 2nd. | |
Public Member Functions | |
| OutputStreamDeviation (PosixId fileNo) | |
| Construct and enable a new pipe redirection. More... | |
| ~OutputStreamDeviation () | |
| Destroy the OutputStreamDeviation object, restoring the original pipe state. | |
| void | flush (LineHandlingFunctor const &lineProcessingFunctor, std::string_view detectionLocation) |
| Flush the buffer from the original output pipe in a string, allowing to log it where needed. More... | |
This class implements pipe redirection to allow to capture and process externally streamed messages.
Definition at line 68 of file ExternalErrorHandler.hpp.
| geos::OutputStreamDeviation::OutputStreamDeviation | ( | PosixId | fileNo | ) |
Construct and enable a new pipe redirection.
| fileNo | The file descriptor number, as returned by fileno() or can be one of the following: "STDOUT_FILENO" (1), "STDERR_FILENO" (2). |
| void geos::OutputStreamDeviation::flush | ( | LineHandlingFunctor const & | lineProcessingFunctor, |
| std::string_view | detectionLocation | ||
| ) |
Flush the buffer from the original output pipe in a string, allowing to log it where needed.
| lineProcessingFunctor | see LineHandlingFunctor. |
| detectionLocation | A label to describe when the flush() operation is being made, thus explaining to the user when the error has been detected. |