add io::directory_iterator
This commit is contained in:
+9
-3
@@ -49,6 +49,12 @@ void io::create_subdevice(
|
||||
set_device(name, std::make_shared<io::SubDevice>(parentDevice, root.pathPart()));
|
||||
}
|
||||
|
||||
io::directory_iterator::directory_iterator(const io::path& folder)
|
||||
: folder(folder) {
|
||||
auto& device = io::require_device(folder.entryPoint());
|
||||
generator = device.list(folder.pathPart());
|
||||
}
|
||||
|
||||
io::rafile::rafile(const io::path& filename)
|
||||
: file(io::resolve(filename), std::ios::binary | std::ios::ate) {
|
||||
if (!file) {
|
||||
@@ -171,7 +177,7 @@ std::vector<std::string> io::read_list(const io::path& filename) {
|
||||
}
|
||||
|
||||
bool io::is_regular_file(const io::path& file) {
|
||||
if (file.empty()) {
|
||||
if (file.emptyOrInvalid()) {
|
||||
return false;
|
||||
}
|
||||
auto device = io::get_device(file.entryPoint());
|
||||
@@ -182,7 +188,7 @@ bool io::is_regular_file(const io::path& file) {
|
||||
}
|
||||
|
||||
bool io::is_directory(const io::path& file) {
|
||||
if (file.empty()) {
|
||||
if (file.emptyOrInvalid()) {
|
||||
return false;
|
||||
}
|
||||
auto device = io::get_device(file.entryPoint());
|
||||
@@ -193,7 +199,7 @@ bool io::is_directory(const io::path& file) {
|
||||
}
|
||||
|
||||
bool io::exists(const io::path& file) {
|
||||
if (file.empty()) {
|
||||
if (file.emptyOrInvalid()) {
|
||||
return false;
|
||||
}
|
||||
auto device = io::get_device(file.entryPoint());
|
||||
|
||||
Reference in New Issue
Block a user