GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
help.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1993-2018 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software: you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <https://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if ! defined (octave_help_h)
24 #define octave_help_h 1
25 
26 #include "octave-config.h"
27 
28 #include <iosfwd>
29 #include <string>
30 
31 class string_vector;
32 
33 class octave_value;
34 class octave_value_list;
35 
36 namespace octave
37 {
38  class interpreter;
39 
41  {
42  public:
43 
45  : m_interpreter (interp),
50  m_makeinfo_program ("makeinfo"),
53  { }
54 
57 
60 
62  {
63  return set (m_built_in_docstrings_file, file);
64  }
65 
67 
68  std::string doc_cache_file (void) const { return m_doc_cache_file; }
69 
71  {
72  return set (m_doc_cache_file, file);
73  }
74 
76 
77  std::string info_file (void) const { return m_info_file; }
78 
80  {
81  return set (m_info_file, file);
82  }
83 
85 
86  std::string info_program (void) const { return m_info_program; }
87 
89  {
90  return set (m_info_program, file);
91  }
92 
94 
96 
98  {
99  return set (m_makeinfo_program, file);
100  }
101 
104 
106  {
108  }
109 
111  {
112  return set (m_suppress_verbose_help_message, flag);
113  }
114 
116 
118 
120  {
121  return set (m_texi_macros_file, file);
122  }
123 
124  std::string raw_help (const std::string&, bool&) const;
125 
126  std::string which (const std::string& name) const;
128 
129  string_vector make_name_list (void) const;
130 
132  std::string& format) const;
133 
135  std::string& format) const;
136 
137  private:
138 
140 
141  // Name of the file containing doc strings for built-in functions.
142  // (--built-in-docstrings-file file)
144 
145  // Name of the doc cache file specified on the command line.
146  // (--doc-cache-file file)
148 
149  // Name of the info file specified on command line.
150  // (--info-file file)
152 
153  // Name of the info reader we'd like to use.
154  // (--info-program program)
156 
157  // Name of the makeinfo program to run.
159 
160  // If TRUE, don't print additional help message in help and usage
161  // functions.
163 
164  // Name of the file containing local Texinfo macros that are prepended
165  // to doc strings before processing.
166  // (--texi-macros-file)
168 
170 
171  static std::string init_doc_cache_file (void);
172 
173  static std::string init_info_file (void);
174 
175  static std::string init_info_program (void);
176 
177  static std::string init_texi_macros_file (void);
178 
179  template <typename T>
180  T set (T& var, const T& new_val)
181  {
182  T old_val = var;
183  var = new_val;
184  return old_val;
185  }
186 
187  string_vector local_functions (void) const;
188 
191  bool& symbol_found) const;
192 
193  bool raw_help_from_file (const std::string& nm,
195  bool& symbol_found) const;
196 
198  bool& symbol_found) const;
199  };
200 
201  extern string_vector make_name_list (void);
202 }
203 
204 #endif
static std::string init_texi_macros_file(void)
std::string doc_cache_file(void) const
Definition: help.h:68
bool m_suppress_verbose_help_message
Definition: help.h:162
For example cd octave end example noindent changes the current working directory to file
Definition: dirfns.cc:124
fname
Definition: load-save.cc:767
std::string info_program(const std::string &file)
Definition: help.h:88
bool suppress_verbose_help_message(void) const
Definition: help.h:105
static std::string init_doc_cache_file(void)
std::string makeinfo_program(const std::string &file)
Definition: help.h:97
bool raw_help_from_docstrings_file(const std::string &nm, std::string &h, bool &symbol_found) const
std::string built_in_docstrings_file(void) const
Definition: help.h:59
void get_help_text_from_file(const std::string &fname, std::string &text, std::string &format) const
bool raw_help_from_symbol_table(const std::string &nm, std::string &h, std::string &w, bool &symbol_found) const
string_vector make_name_list(void) const
std::string m_info_file
Definition: help.h:151
var
Definition: givens.cc:88
std::string m_makeinfo_program
Definition: help.h:158
std::string info_file(const std::string &file)
Definition: help.h:79
bool raw_help_from_file(const std::string &nm, std::string &h, std::string &file, bool &symbol_found) const
std::string m_doc_cache_file
Definition: help.h:147
double h
Definition: graphics.cc:11808
nd deftypefn *std::string name
Definition: sysdep.cc:647
OCTAVE_EXPORT octave_value_list isdir nd deftypefn *std::string nm
Definition: utils.cc:975
string_vector make_name_list(void)
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function xample nargout(@histc)
Definition: ov-usr-fcn.cc:997
interpreter & m_interpreter
Definition: help.h:139
void get_help_text(const std::string &name, std::string &text, std::string &format) const
std::complex< double > w(std::complex< double > z, double relerr=0)
is false
Definition: cellfun.cc:400
std::string texi_macros_file(const std::string &file)
Definition: help.h:119
static std::string init_info_file(void)
idx type
Definition: ov.cc:3114
std::string m_texi_macros_file
Definition: help.h:167
LS_TEXT format
Definition: load-save.cc:1616
std::string m_built_in_docstrings_file
Definition: help.h:143
std::string built_in_docstrings_file(const std::string &file)
Definition: help.h:61
std::string makeinfo_program(void) const
Definition: help.h:95
std::string raw_help(const std::string &, bool &) const
string_vector local_functions(void) const
std::string which(const std::string &name) const
help_system(interpreter &interp)
Definition: help.h:44
bool suppress_verbose_help_message(bool flag)
Definition: help.h:110
std::string doc_cache_file(const std::string &file)
Definition: help.h:70
std::string info_file(void) const
Definition: help.h:77
static std::string init_built_in_docstrings_file(void)
std::string m_info_program
Definition: help.h:155
std::string info_program(void) const
Definition: help.h:86
std::string texi_macros_file(void) const
Definition: help.h:117
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
Definition: utils.cc:888
static std::string init_info_program(void)