Mercurial > jwe > octave
view libinterp/corefcn/oct-hist.h @ 29965:939bef0b66e0
merge "namespace octave" and OCTAVE_NAMESPACE_BEGIN/END blocks
In files with both OCTAVE_NAMESPACE_BEGIN/END and "namespace octave"
blocks, merge adjacent blocks. Use the macros in place of "namespace
octave" in affected files and the corresponding header files.
Files affected: call-stack.cc, call-stack.h, defaults.cc, defaults.h,
defun-int.h, display.cc, display.h, environment.cc, environment.h,
error.cc, error.h, event-manager.cc, event-manager.h, fcn-info.cc,
fcn-info.h, help.cc, help.h, input.cc, input.h, interpreter.cc,
interpreter.h, load-path.cc, load-path.h, load-save.cc, load-save.h,
oct-hist.cc, oct-hist.h, pager.cc, pager.h, settings.cc, settings.h,
sighandlers.cc, sighandlers.h, symtab.cc, symtab.h, sysdep.cc,
sysdep.h, utils.cc, utils.h, __ode15__.cc, gzip.cc, ov-fcn-handle.cc,
ov-fcn-handle.h, ov-java.cc, ov-java.h, ov-typeinfo.cc, ov-typeinfo.h,
ov.cc, ov.h, octave.cc, octave.h, lex.ll, oct-parse.yy, profiler.cc,
profiler.h, pt-eval.cc, and pt-eval.h.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 14 Aug 2021 21:50:26 -0400 |
parents | 7854d5752dd2 |
children | 796f54d4ddbf |
line wrap: on
line source
//////////////////////////////////////////////////////////////////////// // // Copyright (C) 1993-2021 The Octave Project Developers // // See the file COPYRIGHT.md in the top-level directory of this // distribution or <https://octave.org/copyright/>. // // 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 // <https://www.gnu.org/licenses/>. // //////////////////////////////////////////////////////////////////////// #if ! defined (octave_oct_hist_h) #define octave_oct_hist_h 1 #include "octave-config.h" #include <string> #include "cmd-hist.h" #include "ovl.h" OCTAVE_NAMESPACE_BEGIN class interpreter; class OCTINTERP_API history_system { public: history_system (interpreter& interp); history_system (const history_system&) = delete; history_system& operator = (const history_system&) = delete; ~history_system (void) = default; void initialize (bool read_history_file = false); void write_timestamp (void); octave_value input_from_tmp_file (const octave_value_list& args, int nargout); bool input_from_tmp_file (void) const { return m_input_from_tmp_file; } bool input_from_tmp_file (bool flag) { return set (m_input_from_tmp_file, flag); } octave_value timestamp_format_string (const octave_value_list& args, int nargout); std::string timestamp_format_string (void) const { return m_timestamp_format_string; } std::string timestamp_format_string (const std::string& file) { return set (m_timestamp_format_string, file); } string_vector do_history (const octave_value_list& args = octave_value_list (), int nargout = 0); void do_edit_history (const octave_value_list& args = octave_value_list ()); void do_run_history (const octave_value_list& args = octave_value_list ()); private: interpreter& m_interpreter; // TRUE means input is coming from temporary history file. bool m_input_from_tmp_file; // The format of the timestamp marker written to the history file when // Octave exits. std::string m_timestamp_format_string; static std::string default_file (void); static int default_size (void); static std::string default_timestamp_format (void); template <typename T> T set (T& var, const T& new_val) { T old_val = var; var = new_val; return old_val; } }; OCTAVE_NAMESPACE_END #endif