boost fs v2/v3 compat

This commit is contained in:
Brian Gerkey 2011-10-21 21:20:23 +00:00
parent 87afcabccf
commit 0352a628c3
1 changed files with 6 additions and 0 deletions

View File

@ -162,7 +162,13 @@ Rosstackage::isStackage(const std::string& path)
void
Rosstackage::addStackage(const std::string& path)
{
#if !defined(BOOST_FILESYSTEM_VERSION) || (BOOST_FILESYSTEM_VERSION == 2)
std::string name = fs::path(path).filename();
#else
// in boostfs3, filename() returns a path, which needs to be stringified
std::string name = fs::path(path).filename().string();
#endif
if(stackages_.find(name) != stackages_.end())
{
// TODO: optionally notify on duplicates