MCPcopy Create free account
hub / github.com/QNapi/qnapi / readFile

Method readFile

libqnapi/src/subconvert/subtitleconverter.cpp:180–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180QStringList SubtitleConverter::readFile(const QString &filename,
181 QString encoding,
182 long atMostLines) const {
183 QStringList buff;
184 long current = 0;
185 QFile inputFile(filename);
186 if (inputFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
187 QTextStream in(&inputFile);
188 in.setCodec(qPrintable(encoding));
189 while (!in.atEnd() && (atMostLines == 0 || current < atMostLines)) {
190 buff += in.readLine();
191 ++current;
192 }
193 inputFile.close();
194 }
195 return buff;
196}
197
198bool SubtitleConverter::writeFile(const QString &filename, QString encoding,
199 const QStringList &lines) const {

Callers

nothing calls this directly

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected