pvAccessCPP 7.1.8
Loading...
Searching...
No Matches
hexDump.h
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
26namespace epics {
27namespace pvData {
28class ByteBuffer;
29}
30namespace pvAccess {
31
32class epicsShareClass HexDump {
33 const char* buf;
34 size_t buflen;
35 size_t _limit;
36 unsigned _groupBy;
37 unsigned _perLine;
38public:
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
50 epicsShareFunc
51 friend std::ostream& operator<<(std::ostream& strm, const HexDump& hex);
52};
53
54epicsShareFunc
55std::ostream& operator<<(std::ostream& strm, const HexDump& hex);
56
57}
58}
59
60#endif /* HEXDUMP_H_ */
valarray< size_t > size() const
basic_ostream< _CharT, _Traits > & operator<<(basic_ostream< _CharT, _Traits > &__os, const basic_string< _CharT, _Traits, _Alloc > &__str)
Copyright - See the COPYRIGHT that is included with this distribution.