遍历文件

void listFiles()

{

    namespace  fs  =  boost::filesystem;

    boost::filesystem::path path=boost::filesystem::current_path();

    fs::directory_iterator item_begin(path);

    fs::directory_iterator item_end;

    for ( ;item_begin   !=  item_end; item_begin ++ )

    {

        if (fs::is_directory( * item_begin))

        {

            std::cout  << item_begin -> path() << " /t[dir] " << std::endl;

                //  PrintAllFile( * item_begin);

        }

        else

        {

            std::cout  << item_begin -> path()<< std::endl;

        }

    }

posted @ 2014-04-30 19:29  代码学习者coding  阅读(224)  评论(0编辑  收藏  举报