]> sigrok.org Git - pulseview.git/commitdiff
Use boost::filesystem::path to get the filename from a path
authorJoel Holdsworth <redacted>
Sat, 1 Mar 2014 10:49:05 +0000 (10:49 +0000)
committerJoel Holdsworth <redacted>
Sat, 1 Mar 2014 11:15:02 +0000 (11:15 +0000)
CMakeLists.txt
pv/device/file.cpp
test/CMakeLists.txt

index ebff3729f1b113a73ebbba68b1fa607ea07d6151..1b9c7d1a2b50fb3106a61c11e81c90df49ff87a7 100644 (file)
@@ -80,9 +80,9 @@ find_package(Threads)
 if(WIN32)
        # On Windows/MinGW we need to use 'thread_win32' instead of 'thread'.
        # The library is named libboost_thread_win32* (not libboost_thread*).
-       find_package(Boost 1.42 COMPONENTS system thread_win32 REQUIRED)
+       find_package(Boost 1.42 COMPONENTS filesystem system thread_win32 REQUIRED)
 else()
-       find_package(Boost 1.42 COMPONENTS system thread REQUIRED)
+       find_package(Boost 1.42 COMPONENTS filesystem system thread REQUIRED)
 endif()
 
 #===============================================================================
index 190b53846bc08071d60df99cd1e759b070b060be..e33be854af1922680b8dae89bfe1581caadaace6 100644 (file)
@@ -22,6 +22,8 @@
 #include "inputfile.h"
 #include "sessionfile.h"
 
+#include <boost/filesystem.hpp>
+
 #include <libsigrok/libsigrok.h>
 
 using std::string;
@@ -36,7 +38,7 @@ File::File(const std::string path) :
 
 std::string File::format_device_title() const
 {
-       return _path;
+       return boost::filesystem::path(_path).filename().string();
 }
 
 File* File::create(const string &name)
index 66dd7e51d3702721b9f757729dfea0fc8dc4dfda..98d8619c0b13c7515d23dbca751751e7b6d9d14b 100644 (file)
@@ -36,9 +36,9 @@ find_package(Threads)
 if(WIN32)
        # On Windows/MinGW we need to use 'thread_win32' instead of 'thread'.
        # The library is named libboost_thread_win32* (not libboost_thread*).
-       find_package(Boost 1.42 COMPONENTS system thread_win32 unit_test_framework REQUIRED)
+       find_package(Boost 1.42 COMPONENTS filesystem system thread_win32 unit_test_framework REQUIRED)
 else()
-       find_package(Boost 1.42 COMPONENTS system thread unit_test_framework REQUIRED)
+       find_package(Boost 1.42 COMPONENTS filesystem system thread unit_test_framework REQUIRED)
 endif()