From 0f47e751cec7e1b0f87863fca59056ab74fb5614 Mon Sep 17 00:00:00 2001 From: Marco Biasini <marco.biasini@unibas.ch> Date: Thu, 22 Nov 2012 14:59:53 +0100 Subject: [PATCH] fix compilation with boost 1.33.1 --- modules/base/src/boost_filesystem_helper.hh | 10 ++++++++++ tools/molck/main.cc | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/base/src/boost_filesystem_helper.hh b/modules/base/src/boost_filesystem_helper.hh index 5418253fd..450ffa94d 100644 --- a/modules/base/src/boost_filesystem_helper.hh +++ b/modules/base/src/boost_filesystem_helper.hh @@ -37,6 +37,16 @@ String BFPathToString(const boost::filesystem::path& path) #endif } +inline String BFPathStem(const boost::filesystem::path& path) { +#if BOOST_FILESYSTEM_VERSION<103400 + String name = BFPathToString(path); + size_t n = name.rfind('.'); + return name.substr(0, n); +#else + return path.stem(); +#endif +} + } diff --git a/tools/molck/main.cc b/tools/molck/main.cc index dab69250c..6b896ac68 100644 --- a/tools/molck/main.cc +++ b/tools/molck/main.cc @@ -370,7 +370,7 @@ int main(int argc, char *argv[]) } if (write_to_file) { fs::path input_file_path(files[i]); - fs::path input_filename = input_file_path.stem(); + fs::path input_filename = BFPathStem(input_file_path); String input_filename_string=BFPathToString(input_filename); -- GitLab