MCPcopy Create free account
hub / github.com/KDE/kdevelop / overwriteExistingFile

Function overwriteExistingFile

kdevplatform/debugger/tests/test_breakpointmodel.cpp:115–121  ·  view source on GitHub ↗

Overwrite the contents of the local file at @p localFileUrl with @p newContents. Check success with RETURN_IF_TEST_FAILED().

Source from the content-addressed store, hash-verified

113/// Overwrite the contents of the local file at @p localFileUrl with @p newContents.
114/// Check success with RETURN_IF_TEST_FAILED().
115void overwriteExistingFile(const QUrl& localFileUrl, const QString& newContents)
116{
117 QFile file(localFileUrl.toLocalFile());
118 QVERIFY(file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::ExistingOnly));
119 QVERIFY(file.write(newContents.toUtf8()) != -1);
120 QVERIFY(file.flush());
121}
122} // unnamed namespace
123
124/// Gather breakpoint marks in the document.

Callers 1

Calls 3

toLocalFileMethod · 0.80
openMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected