summaryrefslogtreecommitdiff
path: root/src/user/lib/fwik/include
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2012-05-19 16:38:56 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2012-05-19 16:38:56 +0200
commitd502fce7d4db492690e39c72fc029aa05a65057d (patch)
treea5797a97212fff8142dc7f61792facca07c904eb /src/user/lib/fwik/include
parent8e07c1db6ba4bedd0f8fe537a6fb0ca80e5d25f4 (diff)
downloadTCE-d502fce7d4db492690e39c72fc029aa05a65057d.tar.gz
TCE-d502fce7d4db492690e39c72fc029aa05a65057d.zip
More improvements in FWIK - more strings, Dir class, ...
Diffstat (limited to 'src/user/lib/fwik/include')
-rw-r--r--src/user/lib/fwik/include/IO/Dir.h24
-rw-r--r--src/user/lib/fwik/include/IO/Node.h5
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);