码迷,mamicode.com
首页 > 其他好文 > 详细

遍历文件

时间:2014-05-01 05:23:07      阅读:310      评论:0      收藏:0      [点我收藏+]

标签:style   div   c   t   size   sp   int   文件   re   line   name   

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;

        }

    }

遍历文件,码迷,mamicode.com

遍历文件

标签:style   div   c   t   size   sp   int   文件   re   line   name   

原文地址:http://www.cnblogs.com/gujianhan/p/3702043.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!