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_PrintableText,
34  DP_CString,
35  DP_GoLiteral,
36  DP_CArray,
37  DP_MimeData,
38  DP_Base64
39  };
40 
41  void toClipboard(DataPrinter::DumpType type, IDataPrintable * printable);
42 
43  void setByteLineLength(int);
44  int byteLineLength() const;
45  // Insert a space after this many bytes
46  static int separatorInterval() { return 8; }
47  // The number of hexadecimal characters per line
48  static int hexChars();
49 
50  static QActionGroup * copyActions(QObject * copyClass, QObject * data = Q_NULLPTR);
51  static DataPrinter * instance();
52 
53 protected slots:
54  void copyIDataBytes(bool);
55 
56 private:
57  QString hexTextDump(const QByteArray printData, bool showASCII);
58  void binaryDump(const QByteArray printData);
59 
60  int byteLineLength_;
61 };
62 
63 #endif // DATA_PRINTER_H
Definition: data_printer.h:24
Definition: idata_printable.h:23