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

Function createFile

plugins/genericprojectmanager/tests/test_projectload.cpp:80–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80bool createFile(const QString& path)
81{
82 QFile f(path);
83 if (!f.open(QIODevice::WriteOnly)) {
84 qWarning() << f.errorString() << path;
85 return false;
86 }
87
88 auto* randomGenerator = QRandomGenerator::global();
89 for (int i = 0; i < 4; ++i) {
90 f.write(QByteArray::number(randomGenerator->generate()));
91 }
92
93 if (!f.flush()) {
94 qWarning() << f.errorString() << path;
95 return false;
96 }
97
98 f.close();
99 return true;
100}
101
102bool writeRandomStructure(QString path, int files)
103{

Callers 5

writeRandomStructureFunction · 0.70
addRemoveFilesMethod · 0.70
removeDirRecursiveMethod · 0.70
raceJobMethod · 0.70
addDuringImportMethod · 0.70

Calls 5

openMethod · 0.45
errorStringMethod · 0.45
writeMethod · 0.45
generateMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected