oracle数据库 boost::filesystem 使用例子
#include
#include
#include
#include
_hover-ignore="1">using namespace boost::filesystem;
using namespace std;
int main(int argc, char* argv[])
{
path p (argv[1]); // p reads clearer than argv[1] in the following code
vector
v2;
try
{
if (exists(p)) // does p actually exist?
{
if (is_regular_file(p)) // is p a regular file?
cout
else if (is_directory(p)) // is p a directory?
{
cout
copy(directory_iterator(p), directory_iterator(), // directory_iterator::value_type
back_inserter(v2)); // is directory_entry, which is
// converted to a path by the
// path stream inserter
for(vector
::iterator bits=v2.begin();bits!=v2.end();++bits){
cout }
}
else
cout }
else
cout }
catch (const filesystem_error& ex)
{
cout }
return 0;
}