#ifndef FS_H_
#define FS_H_
+#include <stdlib.h>
+#include <vector>
+#include <string>
+#include "fspath.h"
+
enum FSNodeType {
- FSNODE_UNKNOWN,
- FSNODE_FILE,
- FSNODE_DIR,
- FSNODE_DEV
+ FSTYPE_UNKNOWN,
+ FSTYPE_FILE,
+ FSTYPE_DIR,
+ FSTYPE_DEV
};
class FSNode {
public:
FSNodeType type;
- char *abs_path;
- char *name, *suffix;
+ FSPath path;
+ std::string short_name;
+ std::vector<std::string> name_lines;
+ size_t size;
+
+ FSNode *parent;
+ std::vector<FSNode*> children;
+ int nfiles, ndirs;
+
+ FSNode();
- void set_path(const char *s);
+ bool expand();
};
+bool init_fs(const char *path = 0);
+void cleanup_fs();
+
+void draw_fs();
+
+FSNode *get_fsnode(const char *path);
+FSNode *get_fsnode(const char *dir, const char *name);
+
#endif // FS_H_