diff --git a/source/coral.cpp b/source/coral.cpp index e31a0e8..e407421 100755 --- a/source/coral.cpp +++ b/source/coral.cpp @@ -495,6 +495,35 @@ export namespace coral { */ virtual expected write(slice const & data) = 0; }; + + /** + * Sequence enumeration interface. + */ + template struct enumerator { + virtual ~enumerator() {} + + /** + * Returns the last-enumerated value. + * + * *Note*: calling this function before first having recieved a `true` value from [enumerate] will result in + * implementation-defined behaviour. + */ + virtual type value() = 0; + + /** + * Attempts to retrieve the next file path in the file tree, returning true if another value was retrieved or + * `false` if there are no more values to be enumerated over. + * + * ```cpp + * while (sequence.enumerate()) { + * do_thing(sequence.value()); + * } + * ``` + * + * The enumerated value may be accessed through [value]. + */ + virtual bool enumerate() = 0; + } } // Input/output operations.