MCPcopy Create free account
hub / github.com/Qv2ray/Qv2ray / StringToFile

Function StringToFile

src/utils/QvHelpers.cpp:66–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64 }
65
66 bool StringToFile(const QString &text, const QString &targetpath)
67 {
68 bool override = false;
69 {
70 QFileInfo info(targetpath);
71 override = info.exists();
72 if (!override && !info.dir().exists())
73 info.dir().mkpath(info.dir().path());
74 }
75 QSaveFile f{ targetpath };
76 f.open(QIODevice::WriteOnly);
77 f.write(text.toUtf8());
78 f.commit();
79 return override;
80 }
81 QString JsonToString(const QJsonObject &json, QJsonDocument::JsonFormat format)
82 {
83 QJsonDocument doc;

Callers 11

signalHandlerFunction · 0.85
SavePluginSettingsMethod · 0.85
SaveGlobalSettingsFunction · 0.85
UpgradeConfig_IncFunction · 0.85
StartConnectionMethod · 0.85
SaveConnectionConfigMethod · 0.85
UpdateConnectionMethod · 0.85
SaveRoutesMethod · 0.85
terminateUIInternalMethod · 0.85

Calls 1

openMethod · 0.45

Tested by

no test coverage detected