+/**
+Loads configuration from a file, if it exists.
+*/
+void Config::load(const Path::Path &fn)
+{
+ ifstream in(fn.str().c_str());
+ if(!in) return;
+
+ struct stat st;
+ Path::stat(fn, st);
+ mtime=Time::TimeStamp::from_unixtime(st.st_mtime);
+
+ Parser::Parser parser(in, fn.str());
+ Loader loader(*this);
+ loader.load(parser);
+}
+
+void Config::save(const Path::Path &fn) const
+{
+ ofstream out(fn.str().c_str());
+ if(!out) return;
+
+ for(OptionMap::const_iterator i=options.begin(); i!=options.end(); ++i)
+ out<<"option \""<<i->second.name<<"\" \""<<i->second.value<<"\";\n";
+}
+