MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / saveFile

Method saveFile

launcher/settings/INIFile.cpp:100–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100bool INIFile::saveFile(QString fileName)
101{
102 QByteArray outArray;
103 for (Iterator iter = begin(); iter != end(); iter++)
104 {
105 QString value = iter.value().toString();
106 value = escape(value);
107 outArray.append(iter.key().toUtf8());
108 outArray.append('=');
109 outArray.append(value.toUtf8());
110 outArray.append('\n');
111 }
112
113 try
114 {
115 FS::write(fileName, outArray);
116 }
117 catch (const Exception &e)
118 {
119 qCritical() << e.what();
120 return false;
121 }
122
123 return true;
124}
125
126
127bool INIFile::loadFile(QString fileName)

Callers 3

resumeSaveMethod · 0.80
doSaveMethod · 0.80
test_SaveLoadMethod · 0.80

Calls 4

appendMethod · 0.80
whatMethod · 0.80
writeFunction · 0.50
toStringMethod · 0.45

Tested by 1

test_SaveLoadMethod · 0.64