view C++/doc/Directory/Home.md @ 355:9f1e9c69c223

Directory: - Update documentation - Rename some enums - Directory now derives from std::vector
author David Demelier <markand@malikania.fr>
date Tue, 28 Apr 2015 10:49:26 +0200
parents 5f38366c7654
children
line wrap: on
line source

# Directory

There is one class Directory which let you open and read directories.

## API Reference

### Classes

- [DirectoryEntry](class/DirectoryEntry.md)
- [Directory](class/Directory.md)

### Tutorial

This code lists all files that are in the **/tmp** directory.

````cpp
try {
	Directory directory("/tmp");

	for (const DirectoryEntry &entry : directory) {
		std::cout << "/tmp/" << entry.name() << std::endl;
	}
} catch (const std::exception &ex) {
	std::cerr << "Failed to open /tmp: " << ex.what() << std::endl;
}
````