Classes | Macros | Functions
dbg.h File Reference

This file contains interface and implementation of class #SDH::cDBG, a class for colorfull debug messages. More...

#include "sdhlibrary_settings.h"
#include <iostream>
#include <iomanip>
#include <string>
#include <stdarg.h>
#include <cstring>
#include <stdlib.h>
#include <cstdio>
Include dependency graph for dbg.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  cDBG
 A class to print colored debug messages. More...
 
class  cHexByteString
 dummy class for (debug) stream output of bytes as list of hex values More...
 

Macros

#define VAL(_var)   #_var << "='" << _var << "' "
 
#define VAR(_d, _var)   (_d) << #_var << "='" << _var << "'\n"
 

Functions

VCC_EXPORT std::ostream & operator<< (std::ostream &stream, cHexByteString const &s)
 output the bytes in s to stream as a list of space separated hex bytes (without 0x prefix) More...
 

Detailed Description

This file contains interface and implementation of class #SDH::cDBG, a class for colorfull debug messages.

General file information

Author
Dirk Osswald
Date
2007-02-22

Copyright

Copyright (c) 2007 SCHUNK GmbH & Co. KG


Definition in file dbg.h.

Macro Definition Documentation

◆ VAL

#define VAL (   _var)    #_var << "='" << _var << "' "

Insert name and value of the variable _var. This will insert a "NAME='VALUE' " in an output stream

d = cDBG( true );
v = 42;
s = "test";
d << VAL( v ) << "but " << VAL(s);

Will print "v=42" and "s=test" on stderr

Definition at line 324 of file dbg.h.

◆ VAR

#define VAR (   _d,
  _var 
)    (_d) << #_var << "='" << _var << "'\n"

Print name and value of variable _var in output stream _d. This will print a "NAME='VALUE'" pair for variable _var

d = cDBG( true );
v = 42;
s = "test";
VAR( d, v );
VAR( d, s );

Will print "v='42'" and "s='test'" on stderr

Definition at line 309 of file dbg.h.

Function Documentation

◆ operator<<()

VCC_EXPORT std::ostream& operator<< ( std::ostream &  stream,
cHexByteString const &  s 
)
inline

output the bytes in s to stream as a list of space separated hex bytes (without 0x prefix)

Definition at line 344 of file dbg.h.



sdhlibrary_cpp
Author(s): Dirk Osswald
autogenerated on Mon Feb 28 2022 23:41:52