mirror of
https://github.com/edubart/otclient.git
synced 2025-10-18 21:43:26 +02:00
FML emitter
This commit is contained in:
@@ -53,11 +53,10 @@ bool Configs::load(const std::string& fileName)
|
||||
void Configs::save()
|
||||
{
|
||||
if(!m_fileName.empty()) {
|
||||
std::stringstream out;
|
||||
foreach(auto pair, m_confsMap) {
|
||||
out << pair.first << ": " << pair.second << std::endl;
|
||||
}
|
||||
g_resources.saveFile(m_fileName, out);
|
||||
FML::Emitter emitter;
|
||||
FML::Node *doc = emitter.createDocument();
|
||||
doc->write(m_confsMap);
|
||||
g_resources.saveFile(m_fileName, emitter.emitDocument());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -49,6 +49,7 @@ public:
|
||||
bool loadFile(const std::string& fileName, std::iostream& out);
|
||||
|
||||
bool saveFile(const std::string& fileName, const uchar *data, uint size);
|
||||
bool saveFile(const std::string& fileName, const std::string& data) { return saveFile(fileName, (const uchar*)data.c_str(), data.size()); }
|
||||
bool saveFile(const std::string& fileName, std::istream& in);
|
||||
|
||||
bool deleteFile(const std::string& fileName);
|
||||
|
Reference in New Issue
Block a user