summaryrefslogtreecommitdiffstats
path: root/src/CommandOutput.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/CommandOutput.h')
-rw-r--r--src/CommandOutput.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/CommandOutput.h b/src/CommandOutput.h
index 91d3f61d7..6ee859970 100644
--- a/src/CommandOutput.h
+++ b/src/CommandOutput.h
@@ -17,20 +17,18 @@ class cCommandOutputCallback
public:
virtual ~cCommandOutputCallback() {} // Force a virtual destructor in subclasses
- void vOut(const char * a_Fmt, fmt::printf_args);
+ /** Called when the command wants to output anything; may be called multiple times */
+ virtual void Out(const AString & a_Text) = 0;
- /** Syntax sugar function, calls Out() with Printf()-ed parameters; appends a newline" */
- template <typename... Args>
- void Out(const char * a_Format, const Args & ... a_Args)
+ /** Outputs the specified text, plus a newline. */
+ void OutLn(const AString & aText)
{
- vOut(a_Format, fmt::make_printf_args(a_Args...));
+ Out(aText);
+ Out("\n");
}
- /** Called when the command wants to output anything; may be called multiple times */
- virtual void Out(const AString & a_Text) = 0;
-
/** Called when the command processing has been finished */
- virtual void Finished(void) {}
+ virtual void Finished() {}
} ;
@@ -63,10 +61,10 @@ public:
// cCommandOutputCallback overrides:
virtual void Out(const AString & a_Text) override;
- virtual void Finished(void) override {}
+ virtual void Finished() override {}
/** Returns the accumulated command output in a string. */
- const AString & GetAccum(void) const { return m_Accum; }
+ const AString & GetAccum() const { return m_Accum; }
protected:
/** Output is stored here until the command finishes processing */
@@ -83,7 +81,7 @@ class cLogCommandOutputCallback :
{
public:
// cStringAccumCommandOutputCallback overrides:
- virtual void Finished(void) override;
+ virtual void Finished() override;
} ;
@@ -96,7 +94,7 @@ class cLogCommandDeleteSelfOutputCallback:
{
using Super = cLogCommandOutputCallback;
- virtual void Finished(void) override
+ virtual void Finished() override
{
Super::Finished();
delete this;