#include <Debug.h>

Collaboration diagram for Raw:

Public Member Functions

 Raw (const char *label, const char *data, const size_t size)
RawminLevel (const int aLevel)
 limit data printing to at least the given debugging level More...
Rawhex ()
 print data using two hex digits per byte (decoder: xxd -r -p) More...
Rawgap (bool useGap=true)
std::ostream & print (std::ostream &os) const

Public Attributes

int level

Private Member Functions

void printHex (std::ostream &os) const
 print data bytes using hex notation More...

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...));

Definition at line 184 of file Debug.h.

Constructor & Destructor Documentation

◆ Raw()

Raw::Raw ( const char *  label,
const char *  data,
const size_t  size 

Definition at line 187 of file Debug.h.

Member Function Documentation

◆ gap()

Raw& Raw::gap ( bool  useGap = true)

Definition at line 196 of file Debug.h.

Referenced by Http::Tunneler::handleResponse().

◆ hex()

Raw& Raw::hex ( )

Definition at line 194 of file Debug.h.

Referenced by Downloader::CbDialer::print().

◆ minLevel()

Raw& Raw::minLevel ( const int  aLevel)

Definition at line 191 of file Debug.h.

◆ 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 886 of file debug.cc.

References DBG_DATA, Debug::Context::level, and Debug::SectionLevel().

Referenced by ForceAlert(), and operator<<().

◆ printHex()

void Raw::printHex ( std::ostream &  os) const

Definition at line 874 of file debug.cc.

References for_each().

Member Data Documentation

◆ data_

const char* Raw::data_

Definition at line 215 of file Debug.h.

◆ label_

const char* Raw::label_

Definition at line 214 of file Debug.h.

◆ 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 209 of file Debug.h.

◆ size_

size_t Raw::size_

Definition at line 216 of file Debug.h.

◆ useGap_

bool Raw::useGap_

Definition at line 218 of file Debug.h.

◆ useHex_

bool Raw::useHex_

Definition at line 217 of file Debug.h.

The documentation for this class was generated from the following files:






Web Site Translations