4#include "../File/FileDescriptor.h"
5#include "../Foundation/OpaqueObject.h"
6#include "../Foundation/Result.h"
7#include "../Strings/StringView.h"
11struct FileSystemIterator;
59 friend struct Internal;
76 const Entry&
get()
const {
return currentEntry; }
102 struct InternalDefinition
104 static constexpr int Windows = 4272;
105 static constexpr int Apple = 2104;
106 static constexpr int Default = 2088;
108 static constexpr size_t Alignment =
sizeof(
uint64_t);
110 using Object = Internal;
117 InternalOpaque
internal;
121 bool errorsChecked =
false;
unsigned long long uint64_t
Platform independent (8) bytes unsigned int.
Definition: PrimitiveTypes.h:42
unsigned int uint32_t
Platform independent (4) bytes unsigned int.
Definition: PrimitiveTypes.h:38
Wraps an OS File descriptor to read and write to and from it.
Definition: FileDescriptor.h:57
Contains information on a file or directory.
Definition: FileSystemIterator.h:48
bool isDirectory() const
Check if current entry is a directory.
Definition: FileSystemIterator.h:55
StringView name
Name of current entry (file with extension or directory)
Definition: FileSystemIterator.h:49
uint32_t level
Current level of nesting from start of iteration.
Definition: FileSystemIterator.h:51
StringView path
Absolute path of the current entry.
Definition: FileSystemIterator.h:50
Type type
Tells if it's a file or a directory.
Definition: FileSystemIterator.h:52
Options when iterating (recursive and other options)
Definition: FileSystemIterator.h:64
bool forwardSlashes
true will return paths forward slash / even on Windows
Definition: FileSystemIterator.h:66
bool recursive
true will recurse automatically into subdirectories
Definition: FileSystemIterator.h:65
Iterates files and directories inside a given path.
Definition: FileSystemIterator.h:34
const Entry & get() const
Get current Entry being iterated.
Definition: FileSystemIterator.h:76
Options options
Options to control recursive behaviour and other options.
Definition: FileSystemIterator.h:69
Result checkErrors()
Check if any error happened during iteration.
Definition: FileSystemIterator.h:80
Result init(StringView directory)
Initializes the iterator on a given directory.
Result recurseSubdirectory()
Recurse into current item (assuming Entry::isDirectory == true)
Result enumerateNext()
Returned string is only valid until next enumerateNext call and/or another init call.
~FileSystemIterator()
Destroys the FileSystemIterator object.
Type
Entry type (File or Directory)
Definition: FileSystemIterator.h:41
An ascii string used as boolean result. SC_TRY macro forwards errors to caller.
Definition: Result.h:11
Non-owning view over a range of characters with UTF Encoding.
Definition: StringView.h:47