#include "hexDump.h"
Definition at line 32 of file hexDump.h.
epics::pvAccess::HexDump::HexDump |
( |
const char * |
buf, |
|
|
size_t |
len |
|
) |
| |
epics::pvAccess::HexDump::HexDump |
( |
const pvData::ByteBuffer & |
buf, |
|
|
size_t |
size = (size_t)-1 , |
|
|
size_t |
offset = 0u |
|
) |
| |
|
explicit |
Definition at line 29 of file hexDump.cpp.
31 :buf(bb.getBuffer() + bb.getPosition())
32 ,buflen(bb.getRemaining())
epics::pvAccess::HexDump::~HexDump |
( |
| ) |
|
HexDump& epics::pvAccess::HexDump::bytesPerGroup |
( |
size_t |
n = (size_t)-1 | ) |
|
|
inline |
insert a space after this many bytes
Definition at line 46 of file hexDump.h.
46 { _groupBy = n;
return *
this; }
HexDump& epics::pvAccess::HexDump::bytesPerLine |
( |
size_t |
n = (size_t)-1 | ) |
|
|
inline |
start a new line after this many bytes
Definition at line 48 of file hexDump.h.
48 { _perLine = n;
return *
this; }
HexDump& epics::pvAccess::HexDump::limit |
( |
size_t |
n = (size_t)-1 | ) |
|
|
inline |
safety limit on max bytes printed
Definition at line 44 of file hexDump.h.
44 { _limit = n;
return *
this; }
Definition at line 69 of file hexDump.cpp.
74 const size_t addrwidth = bits2bytes(ilog2(len))*2u;
75 size_t nlines = len/
hex._perLine;
80 for(
size_t l=0; l<nlines; l++)
82 size_t start = l*
hex._perLine;
83 strm<<
"0x"<<
std::hex<<std::setw(addrwidth)<<std::setfill(
'0')<<start;
86 for(
size_t col=0; col<
hex._perLine; col++)
88 if(col%
hex._groupBy == 0) {
92 strm<<
std::hex<<std::setw(2)<<std::setfill(
'0')<<unsigned(
hex.buf[start+col]&0xff);
101 for(
size_t col=0; col<
hex._perLine && start+col<len; col++)
103 if(col%
hex._groupBy == 0) {
106 char val =
hex.buf[start+col]&0xff;
107 if(val>=
' ' && val<=
'~') {
The documentation for this class was generated from the following files: