23 #if ! defined (octave_octave_h) 24 #define octave_octave_h 1 26 #include "octave-config.h" 28 #if defined (__cplusplus) 39 class OCTINTERP_API cmdline_options
43 cmdline_options (
void);
45 cmdline_options (
int argc,
char **
argv);
47 cmdline_options (
const cmdline_options&) =
default;
49 cmdline_options& operator = (
const cmdline_options&) =
default;
51 bool debug_jit (
void)
const {
return m_debug_jit; }
52 bool echo_commands (
void)
const {
return m_echo_commands; }
54 OCTAVE_DEPRECATED (4.4,
"use 'gui' instead")
55 bool force_gui (
void)
const {
return m_gui; }
57 bool forced_interactive (
void)
const {
return m_forced_interactive; }
58 bool forced_line_editing (
void)
const {
return m_forced_line_editing; }
59 bool gui (
void)
const {
return m_gui; }
60 bool inhibit_startup_message (
void)
const {
return m_inhibit_startup_message; }
61 bool jit_compiler (
void)
const {
return m_jit_compiler; }
62 bool line_editing (
void)
const {
return m_line_editing; }
64 OCTAVE_DEPRECATED (4.4,
"use '! gui' instead")
65 bool no_gui (
void)
const {
return ! gui (); }
67 bool no_window_system (
void)
const {
return m_no_window_system; }
68 bool persist (
void)
const {
return m_persist; }
69 bool read_history_file (
void)
const {
return m_read_history_file; }
70 bool read_init_files (
void)
const {
return m_read_init_files; }
71 bool read_site_files (
void)
const {
return m_read_site_files; }
72 bool set_initial_path (
void)
const {
return m_set_initial_path; }
73 bool traditional (
void)
const {
return m_traditional; }
74 bool verbose_flag (
void)
const {
return m_verbose_flag; }
75 std::string code_to_eval (
void)
const {
return m_code_to_eval; }
76 std::list<std::string> command_line_path (
void)
const {
return m_command_line_path; }
77 std::string docstrings_file (
void)
const {
return m_docstrings_file; }
78 std::string doc_cache_file (
void)
const {
return m_doc_cache_file; }
79 std::string exec_path (
void)
const {
return m_exec_path; }
80 std::string image_path (
void)
const {
return m_image_path; }
81 std::string info_file (
void)
const {
return m_info_file; }
82 std::string info_program (
void)
const {
return m_info_program; }
83 std::string texi_macros_file (
void)
const {
return m_texi_macros_file; }
85 string_vector remaining_args (
void)
const {
return m_remaining_args; }
87 void debug_jit (
bool arg) { m_debug_jit =
arg; }
88 void echo_commands (
bool arg) { m_echo_commands =
arg; }
90 OCTAVE_DEPRECATED (4.4,
"use 'gui' instead")
91 void force_gui (
bool arg) { m_gui =
arg; }
93 void forced_line_editing (
bool arg) { m_forced_line_editing =
arg; }
94 void forced_interactive (
bool arg) { m_forced_interactive =
arg; }
95 void gui (
bool arg) { m_gui =
arg; }
96 void inhibit_startup_message (
bool arg) { m_inhibit_startup_message =
arg; }
97 void jit_compiler (
bool arg) { m_jit_compiler =
arg; }
98 void line_editing (
bool arg) { m_line_editing =
arg; }
100 OCTAVE_DEPRECATED (4.4,
"this has been removed and is the default now")
101 void no_gui (
bool) {
return; }
103 void no_window_system (
bool arg) { m_no_window_system =
arg; }
104 void persist (
bool arg) { m_persist =
arg; }
105 void read_history_file (
bool arg) { m_read_history_file =
arg; }
106 void read_init_files (
bool arg) { m_read_init_files =
arg; }
107 void read_site_files (
bool arg) { m_read_site_files =
arg; }
108 void set_initial_path (
bool arg) { m_set_initial_path =
arg; }
109 void traditional (
bool arg) { m_traditional =
arg; }
110 void verbose_flag (
bool arg) { m_verbose_flag =
arg; }
112 void command_line_path (
const std::list<std::string>&
arg) { m_command_line_path =
arg; }
127 bool m_debug_jit =
false;
131 bool m_echo_commands =
false;
139 bool m_forced_interactive =
false;
143 bool m_forced_line_editing =
false;
147 bool m_inhibit_startup_message =
false;
151 bool m_jit_compiler =
false;
155 bool m_line_editing =
true;
159 bool m_no_window_system =
false;
163 bool m_persist =
false;
167 bool m_read_history_file =
true;
171 bool m_read_init_files =
true;
175 bool m_read_site_files =
true;
179 bool m_set_initial_path =
true;
183 bool m_traditional =
false;
187 bool m_verbose_flag =
false;
195 std::list<std::string> m_command_line_path;
246 application (
const cmdline_options& opts = cmdline_options ());
262 cmdline_options
options (
void)
const {
return m_options; }
264 bool have_eval_option_code (
void)
const {
return m_have_eval_option_code; }
266 bool have_script_file (
void)
const {
return m_have_script_file; }
268 bool is_octave_program (
void)
const {
return m_is_octave_program; }
270 bool interpreter_initialized (
void);
272 virtual interpreter& create_interpreter (
void);
274 virtual void initialize_interpreter (
void);
276 virtual int execute_interpreter (
void);
278 virtual void delete_interpreter (
void);
280 virtual int execute (
void) = 0;
282 virtual bool gui_running (
void)
const {
return false; }
283 virtual void gui_running (
bool) { }
285 void program_invocation_name (
const std::string&
nm) { m_program_invocation_name =
nm; }
289 void forced_interactive (
bool arg) { m_options.forced_interactive (
arg); }
291 void interactive (
bool arg);
293 static application * app (
void) {
return instance; }
297 return instance ? instance->m_program_invocation_name :
"";
302 return instance ? instance->m_program_name :
"";
310 static bool is_gui_running (
void)
312 return instance ? instance->gui_running () :
false;
317 static bool forced_interactive (
void);
318 static bool interactive (
void);
341 cmdline_options m_options;
344 bool m_have_eval_option_code =
false;
348 bool m_have_script_file =
false;
353 bool m_is_octave_program =
false;
356 bool m_gui_running =
false;
358 interpreter *m_interpreter =
nullptr;
361 class OCTINTERP_API cli_application :
public application 365 cli_application (
const cmdline_options& opts = cmdline_options ())
369 cli_application (
int argc,
char **
argv)
375 cli_application (
const cli_application&) =
delete;
377 cli_application& operator = (
const cli_application&) =
delete;
379 ~cli_application (
void) =
default;
387 #if defined (__cplusplus) 391 OCTAVE_DEPRECATED (4.4,
"see the Octave documentation for other options")
394 #if defined (__cplusplus)
OCTINTERP_API int octave_main(int argc, char **argv, int embedded)
OCTAVE_EXPORT octave_value_list isdir nd deftypefn *std::string nm
OCTAVE_EXPORT octave_value_list only variables visible in the local scope are displayed The following are valid options
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string