filesystem: fix windows directory iteration
This commit is contained in:
parent
4507511494
commit
de2ef74938
@ -108,6 +108,12 @@ public:
|
|||||||
return dir_path.c_str();
|
return dir_path.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
const char_t *validPath() const {
|
||||||
|
return dir_path.substr(0, dir_path.length()-2).c_str();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
string dir_path;
|
string dir_path;
|
||||||
};
|
};
|
||||||
|
@ -10,7 +10,7 @@ FSLib::Directory::Directory( const string &path_ ) : dir_path( path_ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FSLib::Directory::Iterator::Iterator( const Directory &d_ ) {
|
FSLib::Directory::Iterator::Iterator( const Directory &d_ ) {
|
||||||
if ( !exists( d_.path() ) || !isDirectory( d_.path() ) ) {
|
if ( !exists( d_.validPath() ) || !isDirectory( d_.validPath() ) ) {
|
||||||
throw std::runtime_error(
|
throw std::runtime_error(
|
||||||
"Directory either doesn't exist or isn't a directory" );
|
"Directory either doesn't exist or isn't a directory" );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user