X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=vrfileman;a=blobdiff_plain;f=src%2Ffs.h;h=0eb72edf7425ff56061e6014d716a2f41288599a;hp=c6f95a7982b3f3cd67d5193e9f0164a27c4ad737;hb=eca943b2fb891a01cb4e883c07aad2167a8ac94b;hpb=172da567dcbb634b13069e5c12ae8b6a9b3a29dc diff --git a/src/fs.h b/src/fs.h index c6f95a7..0eb72ed 100644 --- a/src/fs.h +++ b/src/fs.h @@ -1,23 +1,30 @@ #ifndef FS_H_ #define FS_H_ +#include +#include +#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; + size_t size; + + FSNode *parent; + std::vector children; + int nfiles, ndirs; FSNode(); - ~FSNode(); - void set_path(const char *s); + bool expand(); }; bool init_fs(); @@ -25,4 +32,7 @@ void cleanup_fs(); void draw_fs(); +FSNode *get_fsnode(const char *path); +FSNode *get_fsnode(const char *dir, const char *name); + #endif // FS_H_