#include "cross.h"
#include "state.h"
#include "util.h"
-#include <glib.h>
+#include <dcp/filesystem.h>
using std::string;
/* List of config versions to look for in descending order of preference;
* i.e. look at the first one, and if that doesn't exist, try the second, etc.
*/
-static std::vector<std::string> config_versions = { "2.16" };
+static std::vector<std::string> config_versions = { "2.18", "2.16" };
static
boost::filesystem::path
State::read_path (string file)
{
- using namespace boost::filesystem;
-
for (auto i: config_versions) {
auto full = config_path_or_override(i) / file;
- if (exists(full)) {
+ if (dcp::filesystem::exists(full)) {
return full;
}
}
boost::filesystem::path
State::write_path (string file)
{
- boost::filesystem::path p = config_path_or_override(config_versions.front());
- boost::system::error_code ec;
- boost::filesystem::create_directories (p, ec);
+ auto p = config_path_or_override(config_versions.front());
+ dcp::filesystem::create_directories(p);
p /= file;
return p;
}