从目录读取文件名 [英] Read file names from a directory

查看:141
本文介绍了从目录读取文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道,如果有一个简单的方法在C + +从包含许多文件的文件夹中读取一些文件名。如果有人想知道它们都是位图。

I was wondering if there's an easy way in C++ to read a number of file names from a folder containing many files. They are all bitmaps if anyone is wondering.

我不太了解Windows编程,所以我希望它可以使用简单的C ++方法。

I don't know much about windows programming so I was hoping it can be done using simple C++ methods.

推荐答案

Boost提供 basic_directory_iterator ,它提供了一个访问内容的C ++标准符合输入迭代器的目录。如果您可以使用Boost,那么这至少是跨平台代码。

Boost provides a basic_directory_iterator which provides a C++ standard conforming input iterator which accesses the contents of a directory. If you can use Boost, then this is at least cross-platform code.

这篇关于从目录读取文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆