MCPcopy Create free account
hub / github.com/MultiMC/Launcher / parseServersDat

Function parseServersDat

launcher/ui/pages/instance/ServersPage.cpp:97–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95};
96
97static std::unique_ptr <nbt::tag_compound> parseServersDat(const QString& filename)
98{
99 try
100 {
101 QByteArray input = FS::read(filename);
102 std::istringstream foo(std::string(input.constData(), input.size()));
103 auto pair = nbt::io::read_compound(foo);
104
105 if(pair.first != "")
106 return nullptr;
107
108 if(pair.second == nullptr)
109 return nullptr;
110
111 return std::move(pair.second);
112 }
113 catch (...)
114 {
115 return nullptr;
116 }
117}
118
119static bool serializeServerDat(const QString& filename, nbt::tag_compound * levelInfo)
120{

Callers 1

loadMethod · 0.85

Calls 2

readFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected