3 * Used by ByteView and others, to create data dumps in printable
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
13 #ifndef DATA_PRINTER_H
14 #define DATA_PRINTER_H
19 #include <QActionGroup>
21 #include <ui/qt/utils/idata_printable.h>
23 class DataPrinter
: public QObject
27 explicit DataPrinter(QObject
*parent
= 0);
42 void toClipboard(DataPrinter::DumpType type
, IDataPrintable
* printable
);
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();
51 static QActionGroup
* copyActions(QObject
* copyClass
, QObject
* data
= Q_NULLPTR
);
52 static DataPrinter
* instance();
55 void copyIDataBytes(bool);
58 QString
hexTextDump(const QByteArray printData
, bool showASCII
);
59 void binaryDump(const QByteArray printData
);
64 #endif // DATA_PRINTER_H