代码拉取完成,页面将自动刷新
#ifndef COMMANDS_H
#define COMMANDS_H
/** \cond docNever */
#include <QUndoStack>
#include "chunks.h"
/*! CharCommand is a class to provid undo/redo functionality in QHexEdit.
A QUndoCommand represents a single editing action on a document. CharCommand
is responsable for manipulations on single chars. It can insert. overwrite and
remove characters. A manipulation stores allways two actions
1. redo (or do) action
2. undo action.
CharCommand also supports command compression via mergeWidht(). This enables
the user to perform an undo command e.g. 3 steps in a single command.
If you for example insert a new byt "34" this means for the editor doing 3
steps: insert a "00", overwrite it with "03" and the overwrite it with "34". These
3 steps are combined into a single step, insert a "34".
The byte array oriented commands are just put into a set of single byte commands,
which are pooled together with the macroBegin() and macroEnd() functionality of
Qt's QUndoStack.
*/
class UndoStack : public QUndoStack
{
Q_OBJECT
public:
UndoStack(Chunks *chunks, QObject * parent=0);
void insert(qint64 pos, char c);
void insert(qint64 pos, const QByteArray &ba);
void removeAt(qint64 pos, qint64 len=1);
void overwrite(qint64 pos, char c);
void overwrite(qint64 pos, int len, const QByteArray &ba);
private:
Chunks * _chunks;
QObject * _parent;
};
/** \endcond docNever */
#endif // COMMANDS_H
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。