BEEP-8 Helper Lib 1.0.0
Loading...
Searching...
No Matches
shell.h
Go to the documentation of this file.
1
58#pragma once
59#include <memory>
60#include <stdio.h>
61#include <cobj.h>
62#include <cstr.h>
63#include <vector>
64#include <string>
65class CShellObj;
67 friend class CShellObj;
68 str16 _name;
74 virtual int vOnMain( const std::vector< str16 >& tokens )=0;
75protected:
76 CShellObj* _pShellObj = nullptr;
83 bool ShowHelp( const std::vector< str16 >& tokens , const char* help );
84public:
90 int Main( const std::vector< str16 >& tokens ){
91 return vOnMain( tokens );
92 }
97 CShellCmd( const char* name_ );
98 virtual ~CShellCmd(){}
99};
100
101class CHelpShellCmd;
102class ImplCShellObj;
103class CShellObj : public CObj {
104 friend class CHelpShellCmd;
105 ImplCShellObj* _impl;
106 bool _no_history_registration = false;
107 void vOnStep() override;
108 int _Parse();
109 void _SetLineBuff( const char* sz );
110public:
114 void Prompt();
119 std::vector< str16 > GetAvailableCommands();
124 void Register( CShellCmd* cmd_ );
129 void Input( u32 keycode_ );
134 void ExecShellScript( std::shared_ptr< std::string > script_ );
135 CShellObj();
136 ~CShellObj();
137};
Definition shell.cpp:13
Definition cobj.h:44
Definition shell.h:66
bool ShowHelp(const std::vector< str16 > &tokens, const char *help)
Displays help information for the command.
Definition shell.cpp:242
CShellCmd(const char *name_)
Constructor for CShellCmd.
Definition shell.cpp:238
int Main(const std::vector< str16 > &tokens)
Executes the command with the provided tokens.
Definition shell.h:90
Definition shell.h:103
std::vector< str16 > GetAvailableCommands()
Retrieves a list of available commands.
Definition shell.cpp:168
void ExecShellScript(std::shared_ptr< std::string > script_)
Executes a shell script.
Definition shell.cpp:89
void Input(u32 keycode_)
Processes an input keycode.
Definition shell.cpp:104
void Prompt()
Displays the command prompt.
Definition shell.cpp:78
void Register(CShellCmd *cmd_)
Registers a new command with the shell.
Definition shell.cpp:226
Definition shell.cpp:57
Header file for managing dynamic creation and destruction of objects in a game.
Module for managing fixed-size strings.