5#include <QtCore/QRandomGenerator>
6#include <QtCore/QScopeGuard>
26 const int maxAttempts = 20;
27 for (;
i < maxAttempts; ++
i) {
34 if (
i == maxAttempts) {
44 auto cleanup =
qScopeGuard([
this, &inF, &success, nBk] {
52 auto closeTmpF = qScopeGuard([this] { tempFile.close(); });
73 const int maxAttempts = 10;
74 for (;
i < maxAttempts; ++
i) {
80 }
else if (nBk == 1) {
119 success =
write(inF);
123 warnings.append(
tr(
"Exception trying to write file %1").
arg(targetFile));
126 if (status == Status::ShouldWrite)
127 status = Status::SkippedDueToFailure;
135#include "moc_qqmldomfilewriter_p.cpp"
bool flush()
Flushes any buffered data to the file.
bool atEnd() const override
Returns true if the end of the file has been reached; otherwise returns false.
void close() override
Calls QFileDevice::flush() and closes the file.
bool open(OpenMode flags) override
Opens the file using OpenMode mode, returning true if successful; otherwise false.
bool remove()
Removes the file specified by fileName().
void setFileName(const QString &name)
Sets the name of the file.
QString fileName() const override
Returns the name set by setFileName() or to the QFile constructors.
bool rename(const QString &newName)
Renames the file currently specified by fileName() to newName.
bool exists() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
qint64 readLine(char *data, qint64 maxlen)
This function reads a line of ASCII characters from the device, up to a maximum of maxSize - 1 bytes,...
bool shouldRemoveTempFile
Status write(QString targetFile, function_ref< bool(QTextStream &)> write, int nBk=2)
static Q_DECL_CONST_FUNCTION QRandomGenerator * global()
\threadsafe
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Combined button and popup list for selecting options.
QScopeGuard< typename std::decay< F >::type > qScopeGuard(F &&f)
[qScopeGuard]
#define QStringLiteral(str)
gzip write("uncompressed data")