#include <Raw.h>
Public Member Functions | |
Raw (const char *label, const char *data, const size_t size) | |
Raw & | minLevel (const int aLevel) |
limit data printing to at least the given debugging level More... | |
Raw & | hex () |
print data using two hex digits per byte (decoder: xxd -r -p) More... | |
Raw & | gap (bool useGap=true) |
std::ostream & | print (std::ostream &os) const |
Public Attributes | |
int | level |
Private Member Functions | |
void | printHex (std::ostream &os) const |
Private Attributes | |
const char * | label_ |
optional data name or ID; triggers size printing More... | |
const char * | data_ |
raw data to be printed More... | |
size_t | size_ |
data length More... | |
bool | useHex_ |
whether hex() has been called More... | |
bool | useGap_ |
whether to print leading space if label is missing More... | |
Detailed Description
Prints raw and/or non-terminated data safely, efficiently, and beautifully. Allows raw data debugging in debugs() statements with low debugging levels by printing only if higher section debugging levels are configured: debugs(11, DBG_IMPORTANT, "always printed" << Raw(may be printed...));
Constructor & Destructor Documentation
◆ Raw()
|
inline |
Member Function Documentation
◆ gap()
|
inline |
Definition at line 32 of file Raw.h.
References useGap_.
Referenced by Http::Tunneler::handleResponse().
◆ hex()
|
inline |
Definition at line 30 of file Raw.h.
References useHex_.
Referenced by Parser::BinaryTokenizer::got(), and Store::operator<<().
◆ minLevel()
Definition at line 27 of file Raw.h.
References level.
Referenced by Http::Tunneler::handleResponse(), and Store::operator<<().
◆ print()
std::ostream & Raw::print | ( | std::ostream & | os | ) | const |
If debugging is prohibited by the current debugs() or section level, prints nothing. Otherwise, dumps data using one of these formats: " label[size]=data" if label was set and data size is positive " label[0]" if label was set and data size is zero " data" if label was not set and data size is positive "" (i.e., prints nothing) if label was not set and data size is zero
Definition at line 17 of file Raw.cc.
References data_, DBG_DATA, label_, level, PrintHex(), Debug::SectionLevel(), size_, useGap_, and useHex_.
Referenced by operator<<().
◆ printHex()
|
private |
Member Data Documentation
◆ data_
◆ label_
◆ level
int Raw::level |
Minimum section debugging level necessary for printing. By default, small strings are always printed while large strings are only printed if DBG_DATA debugging level is enabled.
Definition at line 45 of file Raw.h.
Referenced by minLevel(), and print().
◆ size_
◆ useGap_
◆ useHex_
The documentation for this class was generated from the following files: