1 Star 0 Fork 1.8K

Oislop./ndd

forked from 爬山虎/ndd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
replacecommand.h 1.29 KB
一键复制 编辑 原始数据 按行查看 历史
#pragma once
#include "command.h"
#include "rcglobal.h"
class CompareWin;
class ReplaceOperRecords {
public:
RC_DIRECTION dir;
int startPos; //开始位置
int srcEndPos;//原始结束位置
char* srcContents; //原始文字内容
int replaceLens;//替换长度
char* replaceContents;//替换内容
ReplaceOperRecords() :startPos(0), srcEndPos(0), srcContents(nullptr), replaceLens(0), replaceContents(nullptr)
{
}
~ReplaceOperRecords()
{
if (srcContents != nullptr)
{
delete[]srcContents;
srcContents = nullptr;
}
if (replaceContents != nullptr)
{
delete[]replaceContents;
replaceContents = nullptr;
}
}
ReplaceOperRecords(const ReplaceOperRecords& other) = delete;
};
class ReplaceCommand :public Command
{
public:
ReplaceCommand(CompareWin* operWin);
virtual ~ReplaceCommand();
virtual int getOperIndex()override;
virtual void undo()override;
virtual QString desc()override;
void setDesc(QString v);
void addRecord(ReplaceOperRecords* v);
void setOperIndex(int v);
private:
QList<ReplaceOperRecords*> m_record;
CompareWin* m_operWin;
int m_index;
QString m_desc;
ReplaceCommand(const ReplaceCommand& o) = delete;
ReplaceCommand& operator=(const ReplaceCommand& o) = delete;
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/Oislop/notepad--.git
[email protected]:Oislop/notepad--.git
Oislop
notepad--
ndd
master

搜索帮助