Boost logo

Boost Users :

From: Scott McMurray (me22.ca+boost_at_[hidden])
Date: 2008-08-15 14:56:00


On Fri, Aug 15, 2008 at 12:57, Scott Finley <sfinley_at_[hidden]> wrote:
>
> bfs_test.cpp: In function 'int main()':
>
> bfs_test.cpp:13: error: 'class
> boost::filesystem::basic_directory_entry<boost::filesystem::basic_path<std::basic_string<char,
> std::char_traits<char>, std::allocator<char> >,
> boost::filesystem::path_traits> >' has no member named 'leaf'
>
> My mistake, or did something change/break?
>

It looks like you now need
     itr->path().leaf()
or
    boost::implicit_cast<bfs::path const &>(*itr).leaf()
( http://beta.boost.org/doc/libs/1_36_0/libs/filesystem/doc/reference.html#Class-template-basic_directory_entry
)

As I recall, this change was part of optimization efforts to make
iterating faster by caching the file_status.

Also, it was decided that some of the names for path decomposition
functions were confusing, particularly branch and leaf, so they were
changed. The new path decomposition table suggests that you should
now be using filename() instead of leaf():
http://beta.boost.org/doc/libs/1_36_0/libs/filesystem/doc/reference.html#Path-decomposition-table
(But it's likely backwards-compatible, so you shouldn't need to.)

HTH,
~ Scott


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net