From 2a3982d4e66c49218e49bc83d23b40d212f3d4f1 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Sun, 8 May 2011 15:10:43 +0100 Subject: [PATCH] Fix build with latest Boost.Filesystem --- src/Config.cpp | 4 ++-- src/NoiseTexture.cpp | 4 ++-- src/Resource.cpp | 13 ++++++------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/Config.cpp b/src/Config.cpp index 3f09840..85b1a6e 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -89,7 +89,7 @@ Config::Config() log() << "Reading config from " << config_file; IXMLParserPtr parser = make_xml_parser("schemas/config.xsd"); - parser->parse(config_file.file_string(), *this); + parser->parse(config_file.string(), *this); // Ignore all the set() calls made by the XML parser am_dirty = false; @@ -148,7 +148,7 @@ void Config::flush() log() << "Saving config to " << config_file; - ofstream ofs(config_file.file_string().c_str()); + ofstream ofs(config_file.string().c_str()); if (!ofs.good()) throw runtime_error("Failed to write to config file"); diff --git a/src/NoiseTexture.cpp b/src/NoiseTexture.cpp index 4059853..c8c7fd4 100644 --- a/src/NoiseTexture.cpp +++ b/src/NoiseTexture.cpp @@ -113,7 +113,7 @@ void NoiseTexture::build_noise(GLubyte* pixels) void NoiseTexture::save_noise(const GLubyte* pixels) { - const string fname = cache_name().file_string(); + const string fname = cache_name().string(); ofstream f; f.open(fname.c_str(), ios::out | ios::binary); @@ -125,7 +125,7 @@ void NoiseTexture::save_noise(const GLubyte* pixels) void NoiseTexture::load_noise(GLubyte *pixels) { - const string fname = cache_name().file_string(); + const string fname = cache_name().string(); ifstream f; f.open(fname.c_str(), ios::in | ios::binary); diff --git a/src/Resource.cpp b/src/Resource.cpp index 9f51f4a..90e6afd 100644 --- a/src/Resource.cpp +++ b/src/Resource.cpp @@ -36,20 +36,20 @@ public: } // IResource interface - string name() const { return my_path.filename(); } + string name() const { return my_path.filename().string(); } string xml_file_name() const { - return (my_path / (name() + ".xml")).file_string(); + return (my_path / (name() + ".xml")).string(); } Handle open_file(const string& a_file_name) { - return Handle((my_path / a_file_name).file_string(), Handle::READ); + return Handle((my_path / a_file_name).string(), Handle::READ); } Handle write_file(const string& a_file_name) { - return Handle((my_path / a_file_name).file_string(), Handle::WRITE); + return Handle((my_path / a_file_name).string(), Handle::WRITE); } private: const path my_path; @@ -119,7 +119,7 @@ static void add_resource(const string& a_class, IResourcePtr a_res) static void add_resource_dir(const char* a_class, const path& a_path) { - const path xml_file = a_path / (a_path.filename() + ".xml"); + const path xml_file = a_path / (a_path.filename().string() + ".xml"); if (!exists(xml_file)) warn() << "Missing resource XML file: " << xml_file; @@ -208,8 +208,7 @@ IResourcePtr make_new_resource(const string& a_res_id, const string& a_class) + " in class " + a_class + ": already exists!"); if (!create_directories(p)) - throw runtime_error("Failed to create resource directory " - + p.file_string()); + throw runtime_error("Failed to create resource directory " + p.string()); IResourcePtr r = IResourcePtr(new FilesystemResource(p)); add_resource(a_class, r); -- 2.39.2