MCPcopy Create free account
hub / github.com/KDE/kdiff3 / detectEncoding

Method detectEncoding

src/SourceData.cpp:310–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308}
309
310std::optional<const QByteArray> SourceData::detectEncoding(const QString& fileName)
311{
312 QFile f(fileName);
313 if(f.open(QIODevice::ReadOnly))
314 {
315 char buf[400];
316
317 qint64 size = f.read(buf, sizeof(buf));
318 return detectEncoding(buf, size);
319 }
320 return {};
321}
322
323void SourceData::readAndPreprocess(const QByteArray& encoding, bool bAutoDetect)
324{

Callers

nothing calls this directly

Calls 3

openMethod · 0.80
valueMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected