Mercurial > hg > octave-nkf
view src/main-cli.cc @ 19978:034bcac0b61c
use of C++ API for running a file (bug #42307)
* octave-cmd.cc: New file providing the new command class octave_cmd;
(prepare_command_editor): common action that all derived command classes
use for method execute;
(octave_cmd_exec::execute): execute method of derived class for executing
ordinary commands in the terminal;
(octave_cmd_eval::execute): execute method of derived class for running a
file (as function if it is a valid identifier or as script)
* octave-cmd.h: providing base and derived classes
* main-window.cc (main_window): _cmd_queue is not a pointer anymore;
(~main_window): _cmd_queue is not a pointer anymore;
(execute_command_in_terminal): use new command class for queuing a command;
(run_file_in_terminal): check for valid identifier moved from here to
the execute method of the related command class;
(run_file_callback): use new class for queuing command, path check moved
from here into the execute method of the command class;
(queue_command): gets new command class instead of a string as input;
(closeEvent): queue command class instead of string;
(execute_command_callback): command queue contains command class instances;
* main-window.h: use new octave-cmd class for queue_command,
the command queue is not a pointer anymore
* module.mk: new files octave-cmd.cc and octave-cmd.h
author | Torsten <ttl@justmail.de> |
---|---|
date | Thu, 19 Feb 2015 22:05:12 +0100 |
parents | 4197fc428c7d |
children |
line wrap: on
line source
/* Copyright (C) 2012-2015 John W. Eaton This file is part of Octave. Octave is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. Octave is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Octave; see the file COPYING. If not, see <http://www.gnu.org/licenses/>. */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include "defaults.h" #include "octave.h" #include "sysdep.h" int main (int argc, char **argv) { octave_process_command_line (argc, argv); sysdep_init (); install_defaults (); octave_initialize_interpreter (argc, argv, 0); return octave_execute_interpreter (); }