![]() |
libcyberradio
22.01.24
|
Class that supports debug output. More...
#include <Debuggable.h>
Public Member Functions | |
| Debuggable (bool debug=false, const std::string &debug_name="", FILE *debug_fp=DEBUG_FP, const std::string &debug_timefmt=DEBUG_TIME_FMT) | |
| Constructs a Debuggable object. More... | |
| virtual | ~Debuggable () |
| Destroys a Debuggable object. | |
| Debuggable (const Debuggable &other) | |
| Copies a Debuggable object. More... | |
| Debuggable & | operator= (const Debuggable &other) |
| Assignment operator for Debuggable objects. More... | |
| virtual void | setDebugName (const std::string &debug_name) |
| Sets the debug name for this object. More... | |
| virtual void | setDebugFile (FILE *debug_fp) |
| Sets the debug file pointer for this object. More... | |
| virtual void | setDebugTimeFormat (const std::string &debug_timefmt) |
| Sets the debug time format for this object. More... | |
| virtual int | debug (const char *format,...) |
| Outputs debug information. More... | |
| virtual const char * | debugBool (bool x) |
| Gets a debug output string for a Boolean value. More... | |
| virtual bool | isDebug () const |
| Gets whether this object produces debug output. More... | |
| virtual std::string | getDebugName () const |
| Gets the debug name for this object. More... | |
| virtual std::string | rawString (const std::string &data) |
| Gets a "raw" string representation of a given data string. More... | |
Class that supports debug output.
This class is intended to be a mixin for other classes, allowing them to support debug output.
Definition at line 38 of file Debuggable.h.
| Debuggable | ( | bool | debug = false, |
| const std::string & | debug_name = "", |
||
| FILE * | debug_fp = DEBUG_FP, |
||
| const std::string & | debug_timefmt = DEBUG_TIME_FMT |
||
| ) |
Constructs a Debuggable object.
| debug | Whether or not to create debug output. |
| debug_name | Name for identifying this object in debug output. |
| debug_fp | File to send debug output to. |
| debug_timefmt | Format string for displaying timestamp, as compatible with strftime(). If this is an empty string, don't display a timestamp. |
Definition at line 28 of file Debuggable.cpp.
| Debuggable | ( | const Debuggable & | other | ) |
Copies a Debuggable object.
| other | The Debuggable object to copy. |
Definition at line 49 of file Debuggable.cpp.
|
virtual |
Outputs debug information.
This method follows the same semantics as printf(). Output is preceded by a timestamp and the name of the object, if provided.
| format | The printf()-style format string. |
| ... | Comma-separated list of arguments to print. Note that these need to be arguments that can be supported natively through printf(). |
Definition at line 95 of file Debuggable.cpp.
|
virtual |
Gets a debug output string for a Boolean value.
| x | Boolean value |
Definition at line 126 of file Debuggable.cpp.
|
virtual |
Gets the debug name for this object.
Definition at line 138 of file Debuggable.cpp.
|
virtual |
Gets whether this object produces debug output.
Definition at line 133 of file Debuggable.cpp.
| Debuggable & operator= | ( | const Debuggable & | other | ) |
Assignment operator for Debuggable objects.
| other | The Debuggable object to copy. |
Definition at line 59 of file Debuggable.cpp.
|
virtual |
Gets a "raw" string representation of a given data string.
"Raw" string representations mimic Python string representations. Whitespace characters are denoted by backslash representations ("\\r", "\\n", "\\t", "\\v", "\\f"), while other non-printable characters are represented with hex representation ("\\x00", etc.)
| data | Data string |
Definition at line 143 of file Debuggable.cpp.
|
virtual |
Sets the debug file pointer for this object.
| debug_fp | File to send debug output to. |
Definition at line 81 of file Debuggable.cpp.
|
virtual |
Sets the debug name for this object.
Use this method to set unique debug names for objects of the same class for easy differentiation.
| debug_name | Name for identifying this object in debug output. |
Definition at line 74 of file Debuggable.cpp.
|
virtual |
Sets the debug time format for this object.
| debug_timefmt | Format string for displaying timestamp, as compatible with strftime(). If this is an empty string, don't display a timestamp. |
Definition at line 88 of file Debuggable.cpp.