MCPcopy Create free account
hub / github.com/cxasm/notepad-- / checkFileCode

Method checkFileCode

src/encodeconvert.cpp:293–307  ·  view source on GitHub ↗

识别文件编码

Source from the content-addressed store, hash-verified

291
292//识别文件编码
293QFuture<EncodeThreadParameter_*> EncodeConvert::checkFileCode(QString filePath, QTreeWidgetItem* item)
294{
295 EncodeThreadParameter_* p = new EncodeThreadParameter_(filePath);
296 p->item = item;
297
298 //int 0相等 1 不等
299 return commitTask([](EncodeThreadParameter_* parameter)->EncodeThreadParameter_*
300 {
301 //整个文件都要扫描完毕。还是怕太慢,最多1000行吧
302 parameter->code = CmpareMode::scanFileRealCode(parameter->filepath,1000);
303 return parameter;
304 }
305 , p);
306
307}
308
309
310CODE_ID EncodeConvert::convertFileToCode(QString& filePath, CODE_ID srcCode, CODE_ID dstCode)

Callers 1

scanFileCodeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected