bettola/common/src/vfs.h

27 lines
389 B
C++

#pragma once
#include <string>
#include <map>
struct vfs_node;
/* Store children for quick lookup by name. */
typedef std::map<std::string, vfs_node*> vfs_child_map;
enum vfs_node_type {
FILE_NODE,
DIR_NODE
};
struct vfs_node {
std::string name;
vfs_node_type type;
/* Files. */
std::string content;
/* Directories. */
vfs_child_map children;
vfs_node* parent;
};