acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
shell.h
1// Created by camilo 2024-03-07 18:37 <3ThomasBorregaardSoresen!!
2#pragma once
3
4
5#include "trace.h"
6#include "acme/constant/posix_shell.h"
7
8
9namespace acme
10{
11
12
13 class CLASS_DECL_ACME shell :
14 virtual public ::object
15 {
16 public:
17
18
19 shell* m_pshellComposite;
20
21
22 shell();
23 ~shell() override;
24
25 virtual bool has_command(const ::scoped_string& scopedstrCommand);
26 virtual bool has_posix_shell_command(const ::scoped_string& scopedstrCommand, enum_posix_shell eposixshell = e_posix_shell_system_default);
27
28 virtual ::i32 posix_shell_command(const ::scoped_string& scopedstrCommand, enum_posix_shell eposixshell = e_posix_shell_system_default, const trace_function& tracefunction = nullptr);
29
30 virtual ::i32 posix_shell_command_memory(const ::scoped_string& scopedstrCommand, bool bInteractive = false, enum_posix_shell eposixshell = e_posix_shell_system_default, const memory_dump_function& memorydumpfunction = nullptr);
31
32 //virtual ::i32 interactive_posix_shell(const ::scoped_string& scopedstrCommand, enum_posix_shell eposixshell = e_posix_shell_system_default);
33
34 //virtual ::string posix_shell_string(const ::scoped_string& scopedstrCommand, enum_posix_shell eposixshell = e_posix_shell_system_default);
35
36 virtual bool posix_shell_protocol_begins_eat(enum_posix_shell& eposixshell, ::string& str);
37
38 virtual void defer_install_posix_shell_command(const ::scoped_string& scopedstr, enum_posix_shell eposixshell = e_posix_shell_system_default, const trace_function& tracefunction = nullptr);
39
40 virtual void install_posix_shell_command(const ::scoped_string& scopedstr, enum_posix_shell eposixshell = e_posix_shell_system_default, const trace_function& tracefunction = nullptr);
41
42 virtual ::string posix_shell_command_install_package(const ::scoped_string& scopedstr, enum_posix_shell eposixshell = e_posix_shell_system_default);
43
44 virtual ::i32 synchronous_posix_terminal(const ::scoped_string& scopedstrCommand, enum_posix_shell eposixshell = e_posix_shell_system_default, const trace_function& tracefunction = nullptr);
45
46 virtual void prepare_argc_argv(::i32& argc, char_pointer * argv, char_pointer cmd_line);
47 virtual ::i32 command(const ::scoped_string& scopedstr, const trace_function& tracefunction = nullptr);
48 virtual ::i32 command_memory(const ::scoped_string& scopedstr, bool bInteractive, const memory_dump_function & memorydumpfunction);
49
50
51
52 //virtual void command_system(string_array_base & straOutput, ::i32 & iExitCode, const ::scoped_string & scopedstr, enum_command_system ecommandsystem = e_command_system_none, const class ::time & waitTimeout = ::time::infinity(), ::particle * pparticleSynchronization = nullptr, ::file::file * pfileLog = nullptr);
53// virtual ::i32 command_system(const ::scoped_string & scopedstr, const ::scoped_string & scopedstrPipe, const trace_function & tracefunction = nullptr);
54 virtual ::i32 command_system(const ::scoped_string& scopedstr, const trace_function& tracefunction = nullptr, const ::file::path& pathWorkingDirectory = {}, ::e_display edisplay = e_display_none);
55 virtual ::i32 command_system_memory(const ::scoped_string& scopedstr, bool bInteractive = false, const memory_dump_function & memorydumpfunction = nullptr, const ::file::path& pathWorkingDirectory = {}, ::e_display edisplay = e_display_none);
56 virtual ::i32 pty2(const ::string_array_base & stra);
57 //virtual ::i32 interactive_command_system(const ::scoped_string& scopedstrPrompt, const ::scoped_string& scopedstrCommand, const trace_function& tracefunction = nullptr, const ::file::path& pathWorkingDirectory = {}, ::e_display edisplay = e_display_none);
58 //virtual ::i32 interactive_command_system_memory(const ::scoped_string& scopedstrPrompt, const ::scoped_string& scopedstrCommand, const memory_dump_function& memorydumpfunction = nullptr, const ::file::path& pathWorkingDirectory = {}, ::e_display edisplay = e_display_none);
59 // virtual ::i32 command_system(const ::scoped_string & scopedstr, const trace_function & tracefunction = nullptr);
63 virtual ::i32 command_system(const ::scoped_string& scopedstr, const class ::time& timeOut = 15_min, const ::file::path& pathWorkingDirectory = {}, ::e_display edisplay = e_display_none);
64 virtual ::string get_output(const ::scoped_string& scopedstr, const class ::time& timeOut = 15_min);
65
66 virtual ::string get_command_output(const ::scoped_string& scopedstr, const class ::time& timeOut = 15_min, ::string * pstrError = nullptr, ::i32 * piExitCode = nullptr);
67
68 virtual ::memory get_command_output_memory(const ::scoped_string& scopedstr, bool bInteractive, const class ::time& timeOut = 15_min, ::memory * pmemoryError = nullptr, ::i32 * piExitCode = nullptr);
69
70 virtual ::i32 get_command_output(::string& strOutput, ::string & strError, const ::scoped_string& scopedstr, const class ::time& timeOut = 15_min);
71
72 virtual ::i32 get_command_output_memory(::memory & memoryOutput, ::memory & memoryError, const ::scoped_string& scopedstr, bool bInteractive = false, const class ::time& timeOut = 15_min);
73
74 virtual ::string get_posix_shell_command_output(const ::scoped_string& scopedstr, enum_posix_shell eposixshell = e_posix_shell_system_default, ::string * pstrError = nullptr, ::i32 * piExitCode = nullptr, const class ::time& timeOut = 15_min);
75
76 virtual ::i32 get_posix_shell_command_output(::string& strOutput, ::string & strError, const ::scoped_string& scopedstr, enum_posix_shell eposixshell = e_posix_shell_system_default, const class ::time& timeOut = 15_min);
77
78
79
80 virtual bool is_executable_in_path(const ::scoped_string& scopedstr);
81
82 virtual void launch_command_system(const ::scoped_string& scopedstr, const ::file::path& pathWorkingDirectory = {}, ::e_display edisplay = e_display_none);
83
84#ifdef WINDOWS_DESKTOP
85
86 virtual ::file::path _get_power_shell_path();
87
88 virtual ::file::path _get_cmd_path();
89
90 //virtual ::string _msys2_shell_command_output(const ::scoped_string& scopedstr, const class ::time& timeOut = 15_min);
91
92#endif
93
94 virtual void launch_process(const ::scoped_string & scopedstr);
95
96
97 };
98
99
100} // namespace acme
101
102
103
virtual::i32 posix_shell_command(const ::scoped_string &scopedstrCommand, enum_posix_shell eposixshell=e_posix_shell_system_default, const trace_function &tracefunction=nullptr)
Definition shell.cpp:661
virtual::i32 posix_shell_command_memory(const ::scoped_string &scopedstrCommand, bool bInteractive=false, enum_posix_shell eposixshell=e_posix_shell_system_default, const memory_dump_function &memorydumpfunction=nullptr)
Definition shell.cpp:719
Definition memory.h:33
include "aura/graphics/image/context.h"
Definition aaaa__defer.h:32