Bayonne2 / Common C++ 2 Framework
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | Friends
HEXdump Class Reference

Produces a dump of a buffer in a hexdump way with its code Ascii translation and relative buffer address. More...

#include <applog.h>

Collaboration diagram for HEXdump:
Collaboration graph
[legend]

Public Member Functions

 HEXdump (const unsigned char *buffer, int buff_len, int max_len=200)
 HEXdump constructor. More...
 
virtual ~HEXdump ()
 HEXdump destructor. More...
 
const char * c_str () const
 const char* cast provided for conveneince. More...
 
std::string str ()
 string cast provided for conveneince. More...
 

Protected Attributes

std::string _str
 output string More...
 

Friends

std::ostream & operator<< (std::ostream &out, const HEXdump &hd)
 operator << More...
 

Detailed Description

Produces a dump of a buffer in a hexdump way with its code Ascii translation and relative buffer address.

For instance: 0000000 - 77 98 21 49 0e 00 05 00 40 1c 01 1c 2f 00 00 00 w.!I....../...

Definition at line 71 of file applog.h.

Constructor & Destructor Documentation

HEXdump::HEXdump ( const unsigned char *  buffer,
int  buff_len,
int  max_len = 200 
)

HEXdump constructor.

Parameters
bufferbuffer to be "hexdumped"
buff_lenbuffer length
max_lenmax number of bytes to be "hexdumped". Usefull to truncate output. mas_len=0 does prints all.
virtual HEXdump::~HEXdump ( )
inlinevirtual

HEXdump destructor.

Definition at line 94 of file applog.h.

Member Function Documentation

const char* HEXdump::c_str ( ) const
inline

const char* cast provided for conveneince.

Definition at line 100 of file applog.h.

std::string HEXdump::str ( )
inline

string cast provided for conveneince.

Definition at line 108 of file applog.h.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const HEXdump hd 
)
friend

operator <<

Parameters
hdhexdump.
Returns
application logger stream

Definition at line 118 of file applog.h.

Field Documentation

std::string HEXdump::_str
protected

output string

Definition at line 77 of file applog.h.


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