diff options
Diffstat (limited to 'src/user/lib/fwik/include')
-rw-r--r-- | src/user/lib/fwik/include/IO/Dir.h | 24 | ||||
-rw-r--r-- | src/user/lib/fwik/include/IO/Node.h | 5 |
2 files changed, 28 insertions, 1 deletions
diff --git a/src/user/lib/fwik/include/IO/Dir.h b/src/user/lib/fwik/include/IO/Dir.h new file mode 100644 index 0000000..bbfe3ed --- /dev/null +++ b/src/user/lib/fwik/include/IO/Dir.h @@ -0,0 +1,24 @@ +#ifndef DEF_FWIK_IO_DIR_H +#define DEF_FWIK_IO_DIR_H + +#include "Node.h" +#include <String.h> + +class Dir : public Node { + void _init(); + + public: + int pos; + + Dir(FILE f); + Dir(const char* file, int mode); + Dir(const Node &n); + virtual ~Dir(); + + String read_ent(); + + virtual Dir* as_dir() { return this; } +}; + +#endif + diff --git a/src/user/lib/fwik/include/IO/Node.h b/src/user/lib/fwik/include/IO/Node.h index ed8290f..6b5b063 100644 --- a/src/user/lib/fwik/include/IO/Node.h +++ b/src/user/lib/fwik/include/IO/Node.h @@ -9,19 +9,22 @@ #include <String.h> class Term; +class Dir; class Node { public: FILE fd; file_info info; - bool valid; + int error; // will be 0 if this is a valid file descriptor Node(FILE f); Node(const char* filename, int mode); + Node(FILE parent, const char* filename, int mode); virtual ~Node() {} void close(); virtual Term* as_term() { return 0; } + virtual Dir* as_dir() { return 0; } }; String path_cat(const String &a, const String &b, bool trailing_slash = true); |