wex
v21.04.0
|
Adds run_tool methods and statistics to a file stream. More...
#include <wex/stream.h>
Public Member Functions | |
stream (const path &filename, const tool &tool) | |
Constructor. | |
virtual | ~stream () |
Destructor. | |
const auto & | get_filename () const |
Returns the filename. | |
const auto & | get_statistics () const |
Returns the statistics. | |
const auto & | get_tool () const |
Returns the tool. | |
bool | run_tool () |
Runs the tool. | |
Static Public Member Functions | |
static void | reset () |
Resets static members. | |
Protected Member Functions | |
virtual bool | process (std::string &text, size_t line_no) |
Processes line. More... | |
virtual bool | process_begin () |
Override to do action before processing begins. More... | |
virtual void | process_end () |
Override to do action after processing has ended. | |
virtual void | process_match (const std::string &line, size_t line_no, int pos) |
Override to do action for a match. More... | |
auto | inc_actions_completed (int inc_value=1) |
Increments the actions completed. | |
auto | inc_statistics (const std::string &keyword) |
Increments statistics keyword. | |
Adds run_tool methods and statistics to a file stream.
|
protectedvirtual |
Processes line.
The default performs a ID_TOOL_REPORT_FIND or REPLACE.
text | contents to be processed (depends on std::getline) |
line_no | line number |
|
protectedvirtual |
Override to do action before processing begins.
The default checks correct tool for find and replace.
|
inlineprotectedvirtual |
Override to do action for a match.
Data is available in find replace data.
line | matching line |
line_no | line number containing match |
pos | pos on line where match starts, -1 not known |