Mercurial > octave
annotate libinterp/corefcn/environment.h @ 29960: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 | 0a5b15007766 |
children | 796f54d4ddbf |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
29358
0a5b15007766
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
3 // Copyright (C) 2017-2021 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
23719 | 25 |
26 #if ! defined (octave_environment_h) | |
27 #define octave_environment_h 1 | |
28 | |
29 #include "octave-config.h" | |
30 | |
31 #include <string> | |
32 | |
33 class octave_value; | |
34 class octave_value_list; | |
35 | |
29960
939bef0b66e0
merge "namespace octave" and OCTAVE_NAMESPACE_BEGIN/END blocks
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
36 OCTAVE_NAMESPACE_BEGIN |
939bef0b66e0
merge "namespace octave" and OCTAVE_NAMESPACE_BEGIN/END blocks
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
37 |
23719 | 38 class environment |
39 { | |
40 public: | |
41 | |
25460
627d6bde9b8d
solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
25439
diff
changeset
|
42 environment (void) |
23719 | 43 : m_editor (init_editor ()), |
25460
627d6bde9b8d
solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
25439
diff
changeset
|
44 m_exec_path (init_exec_path ()), |
627d6bde9b8d
solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
25439
diff
changeset
|
45 m_image_path (init_image_path ()) |
23719 | 46 { } |
47 | |
48 octave_value editor (const octave_value_list& args, int nargout); | |
49 | |
50 std::string editor (void) const { return m_editor; } | |
51 | |
52 std::string editor (const std::string& ed) | |
53 { | |
54 return set (m_editor, ed); | |
55 } | |
56 | |
57 octave_value exec_path (const octave_value_list& args, int nargout); | |
58 | |
59 std::string exec_path (void) const { return m_exec_path; } | |
60 | |
61 std::string exec_path (const std::string& path); | |
62 | |
63 octave_value image_path (const octave_value_list& args, int nargout); | |
64 | |
65 std::string image_path (void) const { return m_image_path; } | |
66 | |
67 std::string image_path (const std::string& path) | |
68 { | |
69 return set (m_image_path, path); | |
70 } | |
71 | |
72 private: | |
73 | |
74 std::string m_editor; | |
75 | |
76 std::string m_exec_path; | |
77 | |
78 std::string m_image_path; | |
79 | |
80 static std::string init_editor (void); | |
81 | |
25460
627d6bde9b8d
solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
25439
diff
changeset
|
82 static std::string init_exec_path (void); |
23719 | 83 |
25460
627d6bde9b8d
solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
25439
diff
changeset
|
84 static std::string init_image_path (void); |
23719 | 85 |
86 std::string set (std::string& var, const std::string& new_val) | |
87 { | |
88 std::string old_val = var; | |
89 var = new_val; | |
90 return old_val; | |
91 } | |
92 }; | |
29960
939bef0b66e0
merge "namespace octave" and OCTAVE_NAMESPACE_BEGIN/END blocks
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
93 |
939bef0b66e0
merge "namespace octave" and OCTAVE_NAMESPACE_BEGIN/END blocks
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
94 OCTAVE_NAMESPACE_END |
23719 | 95 |
96 #endif |