Wireshark  4.3.0
The Wireshark network protocol analyzer
data_printer.h
Go to the documentation of this file.
1 
13 #ifndef DATA_PRINTER_H
14 #define DATA_PRINTER_H
15 
16 #include <config.h>
17 
18 #include <QObject>
19 #include <QActionGroup>
20 
22 
23 class DataPrinter : public QObject
24 {
25  Q_OBJECT
26 public:
27  explicit DataPrinter(QObject *parent = 0);
28 
29  enum DumpType {
30  DP_HexDump,
31  DP_HexOnly,
32  DP_HexStream,
33  DP_UTF8Text,
34  DP_ASCIIText,
35  DP_CString,
36  DP_GoLiteral,
37  DP_CArray,
38  DP_MimeData,
39  DP_Base64
40  };
41 
42  void toClipboard(DataPrinter::DumpType type, IDataPrintable * printable);
43 
44  void setByteLineLength(int);
45  int byteLineLength() const;
46  // Insert a space after this many bytes
47  static int separatorInterval() { return 8; }
48  // The number of hexadecimal characters per line
49  static int hexChars();
50 
51  static QActionGroup * copyActions(QObject * copyClass, QObject * data = Q_NULLPTR);
52  static DataPrinter * instance();
53 
54 protected slots:
55  void copyIDataBytes(bool);
56 
57 private:
58  QString hexTextDump(const QByteArray printData, bool showASCII);
59  void binaryDump(const QByteArray printData);
60 
61  int byteLineLength_;
62 };
63 
64 #endif // DATA_PRINTER_H
Definition: data_printer.h:24
Definition: idata_printable.h:23