MCPcopy Create free account
hub / github.com/QuasarApp/CQtDeployer / deployFile

Method deployFile

tests/units/testutils.cpp:123–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123bool TestUtils::deployFile(const QString &file, const QString &distanation,
124 const QHash<QByteArray, QByteArray> &replaceCase) const {
125 QFile f(file);
126
127 if (f.open(QIODevice::ReadOnly)) {
128 QFile dist(distanation);
129 if (!dist.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
130 return false;
131 }
132
133 QByteArray data = f.readAll();
134 for (auto it = replaceCase.begin(); it != replaceCase.end(); ++it) {
135 data.replace(it.key(), it.value());
136 }
137
138 return dist.write(data);
139 }
140
141 return false;
142}
143

Callers 1

testMethod · 0.80

Calls 2

keyMethod · 0.80
replaceMethod · 0.45

Tested by

no test coverage detected