This is Unofficial EPICS BASE Doxygen Site
hexDump.h
Go to the documentation of this file.
1 
7 #ifndef HEXDUMP_H_
8 #define HEXDUMP_H_
9 
10 #include <ostream>
11 
12 #ifdef epicsExportSharedSymbols
13 # define hexDumpEpicsExportSharedSymbols
14 # undef epicsExportSharedSymbols
15 #endif
16 
17 #include <pv/pvType.h>
18 
19 #ifdef hexDumpEpicsExportSharedSymbols
20 # define epicsExportSharedSymbols
21 # undef hexDumpEpicsExportSharedSymbols
22 #endif
23 
24 #include <shareLib.h>
25 
26 namespace epics {
27 namespace pvData {
28 class ByteBuffer;
29 }
30 namespace pvAccess {
31 
33  const char* buf;
34  size_t buflen;
35  size_t _limit;
36  unsigned _groupBy;
37  unsigned _perLine;
38 public:
39  HexDump(const char* buf, size_t len);
40  explicit HexDump(const pvData::ByteBuffer& buf, size_t size=(size_t)-1, size_t offset=0u);
41  ~HexDump();
42 
44  inline HexDump& limit(size_t n=(size_t)-1) { _limit = n; return *this; }
46  inline HexDump& bytesPerGroup(size_t n=(size_t)-1) { _groupBy = n; return *this; }
48  inline HexDump& bytesPerLine(size_t n=(size_t)-1) { _perLine = n; return *this; }
49 
51  friend std::ostream& operator<<(std::ostream& strm, const HexDump& hex);
52 };
53 
55 std::ostream& operator<<(std::ostream& strm, const HexDump& hex);
56 
57 }
58 }
59 
60 #endif /* HEXDUMP_H_ */
#define epicsShareFunc
Definition: shareLib.h:209
TODO only here because of the Lockable.
Definition: ntaggregate.cpp:16
Mark external symbols and entry points for shared libraries.
std::ostream & operator<<(std::ostream &o, const Field &f)
HexDump & bytesPerLine(size_t n=(size_t)-1)
start a new line after this many bytes
Definition: hexDump.h:48
HexDump & limit(size_t n=(size_t)-1)
safety limit on max bytes printed
Definition: hexDump.h:44
#define epicsShareClass
Definition: shareLib.h:206
This class implements a Bytebuffer that is like the java.nio.ByteBuffer.
Definition: byteBuffer.h:233
Definition: tool_lib.h:64
HexDump & bytesPerGroup(size_t n=(size_t)-1)
insert a space after this many bytes
Definition: hexDump.h:46