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

Method writeKeyArray

src/Deploy/src/configparser.cpp:240–271  ·  view source on GitHub ↗

FIX ME. if package contains the path separators then package rewrite to RelativeLink of configFile location

Source from the content-addressed store, hash-verified

238
239// FIX ME. if package contains the path separators then package rewrite to RelativeLink of configFile location
240QJsonValue ConfigParser::writeKeyArray(int separatorLvl, const QString &parameter,
241 const QString &confFileDir) const {
242
243 const auto list = parameter.split(DeployCore::getSeparator(separatorLvl));
244
245 if (DeployCore::isContainsArraySeparators(parameter)) {
246 QJsonArray array;
247
248 for (const auto &i: list) {
249 array.push_back(writeKeyArray(separatorLvl + 1, i, confFileDir));
250 }
251
252 return array;
253 }
254
255 if (list.size() && list.first().isEmpty()) {
256 return QJsonValue(true);
257 }
258
259 auto val = list.first();
260
261 if (PathUtils::isPath(val)) {
262
263 val = PathUtils::getRelativeLink(
264 QFileInfo(confFileDir).absoluteFilePath(),
265 QFileInfo(val).absoluteFilePath());
266
267 }
268
269 return val;
270
271}
272
273void ConfigParser::writeKey(const QString& key, QJsonObject& obj,
274 const QString& confFileDir) const {

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected