KTextEditor
katetextloader.h
65 KCompressionDevice::CompressionType compressionType = KCompressionDevice::compressionTypeForMimeType(m_mimeType);
93 m_converterState = m_codec.isEmpty() ? QStringDecoder() : QStringDecoder(m_codec.toUtf8().constData());
196 const auto lineLimitHandler = [this, &offset, &length, &tooLongLinesWrapped, &longestLineLoaded](int lineStart, int textLength) {
207 for (int testPosition = m_lineLengthLimit - 1; (testPosition >= 0) && (testPosition >= (m_lineLengthLimit - (m_lineLengthLimit / 10)));
232 if (m_alreadyScanned > m_lastLineStart && lineLimitHandler(m_lastLineStart, m_alreadyScanned - m_lastLineStart)) {
259 if (const QStringDecoder decoder(prober.encoding().constData()); decoder.isValid() && (prober.confidence() > 0.5)) {
274 m_converterState = QStringDecoder(m_converterState.name(), QStringConverter::Flag::ConvertInitialBom);
286 if (m_firstRead && !unicode.isEmpty() && (unicode.front() == QChar::ByteOrderMark || unicode.front() == QChar::ByteOrderSwapped)) {
static CompressionType compressionTypeForMimeType(const QString &mimetype)
CompressionType
float confidence() const
ProberState feed(QByteArrayView data)
QByteArray encoding() const
File Loader, will handle reading of files + detecting encoding.
Definition katetextloader.h:34
const QString & mimeTypeForFilterDev() const
mime type used to create filter dev
Definition katetextloader.h:142
TextLoader(const QString &filename, KEncodingProber::ProberType proberType, int lineLengthLimit)
Construct file loader for given file.
Definition katetextloader.h:42
bool readLine(int &offset, int &length, bool &tooLongLinesWrapped, int &longestLineLoaded)
read a line, return length + offset in Unicode data
Definition katetextloader.h:173
TextBuffer::EndOfLineMode eol() const
Detected end of line mode for this file.
Definition katetextloader.h:124
const char * constData() const const
char * data()
qsizetype size() const const
ByteOrderMark
bool addData(QIODevice *device)
void reset()
QByteArray result() const const
bool open(FILE *fh, OpenMode mode, FileHandleFlags handleFlags)
virtual qint64 size() const const override
virtual void close()
bool isOpen() const const
virtual bool open(QIODeviceBase::OpenMode mode)
QByteArray read(qint64 maxSize)
ReadOnly
QMimeType mimeTypeForFileNameAndData(const QString &fileName, QIODevice *device) const const
name
QString & append(QChar ch)
QString arg(Args &&... args) const const
const QChar at(qsizetype position) const const
void clear()
QString fromUtf8(QByteArrayView str)
bool isEmpty() const const
qsizetype length() const const
QString & remove(QChar ch, Qt::CaseSensitivity cs)
QByteArray toLatin1() const const
QByteArray toUtf8() const const
const QChar * unicode() const const
bool hasError() const const
bool isValid() const const
const char * name() const const
EncodedData< QByteArrayView > decode(QByteArrayView ba)
QStringDecoder decoderForHtml(QByteArrayView data)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:11:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:11:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.