24 #include <boost/property_tree/xml_parser.hpp>
34 Preferences::Preferences(
const std::string& file)
39 read_xml(m_file, p, trim_whitespace);
40 m_preferences = p.get_child(
"preferences");
43 catch (xml_parser_error&) {}
44 catch (ptree_bad_path&) {}
47 Preferences::Preferences(Preferences&& other)
48 : m_preferences(move(other.m_preferences)),
49 m_file(move(other.m_file))
53 const ptree& Preferences::GetPreferences()
const
58 void Preferences::SetPreferences(
const ptree& prefs)
60 m_preferences = prefs;
62 p.put_child(
"preferences", m_preferences);
63 write_xml(m_file, p, std::locale(), XmlWriterSettings::GetTab());
64 Notify({m_preferences});
Namespace for miscellaneous utilities.
Interface for Preferences.
Xml writer settings class.
Namespace for generic graphical shell for simulators.