MCPcopy Create free account
hub / github.com/Simsys/qhexedit2 / CharCommand

Class CharCommand

src/commands.cpp:6–26  ·  view source on GitHub ↗

Helper class to store single byte commands

Source from the content-addressed store, hash-verified

4
5// Helper class to store single byte commands
6class CharCommand : public QUndoCommand
7{
8public:
9 enum CCmd {insert, removeAt, overwrite};
10
11 CharCommand(Chunks * chunks, CCmd cmd, qint64 charPos, char newChar,
12 QUndoCommand *parent=0);
13
14 void undo();
15 void redo();
16 bool mergeWith(const QUndoCommand *command);
17 int id() const { return 1234; }
18
19private:
20 Chunks * _chunks;
21 qint64 _charPos;
22 bool _wasChanged;
23 char _newChar;
24 char _oldChar;
25 CCmd _cmd;
26};
27
28CharCommand::CharCommand(Chunks * chunks, CCmd cmd, qint64 charPos, char newChar, QUndoCommand *parent)
29 : QUndoCommand(parent)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected