fs/DirectoryReader: use C++11 initializer

This commit is contained in:
Max Kellermann 2015-12-29 12:42:08 +01:00
parent 08754e6ce7
commit 826a654c95

View File

@ -34,7 +34,7 @@
class DirectoryReader { class DirectoryReader {
const HANDLE handle; const HANDLE handle;
WIN32_FIND_DATA data; WIN32_FIND_DATA data;
bool first; bool first = true;
class MakeWildcardPath { class MakeWildcardPath {
PathTraitsFS::pointer path; PathTraitsFS::pointer path;
@ -63,8 +63,8 @@ public:
* Creates new directory reader for the specified #dir. * Creates new directory reader for the specified #dir.
*/ */
explicit DirectoryReader(Path dir) explicit DirectoryReader(Path dir)
:handle(FindFirstFile(MakeWildcardPath(dir.c_str()), &data)), :handle(FindFirstFile(MakeWildcardPath(dir.c_str()), &data)) {
first(true) {} }
DirectoryReader(const DirectoryReader &other) = delete; DirectoryReader(const DirectoryReader &other) = delete;
DirectoryReader &operator=(const DirectoryReader &other) = delete; DirectoryReader &operator=(const DirectoryReader &other) = delete;
@ -113,14 +113,14 @@ public:
*/ */
class DirectoryReader { class DirectoryReader {
DIR *const dirp; DIR *const dirp;
dirent *ent; dirent *ent = nullptr;
public: public:
/** /**
* Creates new directory reader for the specified #dir. * Creates new directory reader for the specified #dir.
*/ */
explicit DirectoryReader(Path dir) explicit DirectoryReader(Path dir)
: dirp(opendir(dir.c_str())), :dirp(opendir(dir.c_str())) {
ent(nullptr) {
} }
DirectoryReader(const DirectoryReader &other) = delete; DirectoryReader(const DirectoryReader &other) = delete;