fs::get_config_dir, fs::get_executable_dir

This commit is contained in:
Nekotekina 2015-12-16 22:50:45 +03:00
parent 56ba5a765b
commit 321e6d3a86
21 changed files with 249 additions and 178 deletions

View file

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "config.h"
#include <fstream>
#include "Utilities/File.h"
namespace rpcs3
{
@ -32,23 +33,13 @@ namespace rpcs3
void config_t::load()
{
if (!m_path.empty())
{
std::ifstream stream{ m_path };
if (stream)
deserialize(stream);
}
from_string(fs::file(m_path));
}
void config_t::save() const
{
if (!m_path.empty())
{
std::ofstream stream{ m_path };
if (stream)
serialize(stream);
}
fs::file(m_path, fom::rewrite) << to_string();
}
config_t config{ "rpcs3.new.ini" };
config_t config{ fs::get_config_dir() + "rpcs3.new.ini" };
}