//--- // fxos-shell.session: All the data used in an interactive session //--- #ifndef FXOS_SESSION_H #define FXOS_SESSION_H #include #include #include #include using namespace FxOS; namespace fs = std::filesystem; struct Session { /* Empty session with a single empty virtual space */ Session(); //--- // Environment //--- /* Search path, folders from FXOS_LIBRARY essentially */ std::vector path; /* Find file by name by searching through the path */ fs::path file(std::string name); //--- // Virtual spaces //--- /* Virtual spaces organized by name */ std::map> spaces; /* Find a virtual space by name */ VirtualSpace *get_space(std::string name); /* Current virtual space */ VirtualSpace *current_space; /* Find an unused name from this prefix. If force_suffix is set, always adds a suffix even if the name itself is free */ std::string generate_space_name(std::string prefix, bool force_suffix=false); //--- // //--- /* Current cursor location */ uint32_t pc; }; #endif /* FXOS_SESSION_H */