vtdata library
Public Member Functions | List of all members
dir_iter Class Reference

Public Member Functions

 dir_iter ()
 
 dir_iter (std::string const &dirname)
 
bool is_directory ()
 Returns true if the current object is a directory.
 
bool is_hidden ()
 Returns true if the current object is hidden.
 
std::string filename ()
 Get the filename fo the current object.
 
void operator++ ()
 
bool operator!= (const dir_iter &it)
 

Detailed Description

A portable class for reading directory contents.

Example of use:

for (dir_iter it("C:/temp"); it != dir_iter(); ++it)
{
if (it.is_hidden())
continue;
if (it.is_directory())
printf("Directory: '%s'\n", it.filename().c_str());
else
printf("File: '%s'\n", it.filename().c_str());
}

Constructor & Destructor Documentation

dir_iter::dir_iter ( )

The dir_iter class provides a cross-platform way to read directories. It is addapted from the 'boost' library, without encurring the huge overhead of adding boost as a dependency.