Mercurial > octave-nkf
annotate src/load-path.h @ 9581:3d0d2bda3a0f
fix previous change, avoid duplicate loads of methods in descendant classes
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Thu, 27 Aug 2009 16:08:23 +0200 |
parents | 0c7d84a65386 |
children | d6b2b708b6b0 |
rev | line source |
---|---|
5832 | 1 /* |
2 | |
8920 | 3 Copyright (C) 2006, 2007, 2008, 2009 John W. Eaton |
5832 | 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 the | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
5832 | 11 |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
5832 | 20 |
21 */ | |
22 | |
23 #if !defined (octave_load_path_h) | |
24 #define octave_load_path_h 1 | |
25 | |
8950
d865363208d6
include <iosfwd> instead of <iostream> in header files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
26 #include <iosfwd> |
5832 | 27 #include <list> |
28 #include <map> | |
29 #include <string> | |
30 | |
5835 | 31 #include "pathsearch.h" |
5832 | 32 #include "str-vec.h" |
33 | |
34 class | |
6241 | 35 OCTINTERP_API |
5832 | 36 load_path |
37 { | |
38 protected: | |
39 | |
9010
f914834836e7
Partial implementation of derived classes using the old form with "@" files.
rtshort@smoketree.phaselocked.com
parents:
8950
diff
changeset
|
40 load_path (void) |
9581
3d0d2bda3a0f
fix previous change, avoid duplicate loads of methods in descendant classes
Jaroslav Hajek <highegg@gmail.com>
parents:
9458
diff
changeset
|
41 : dir_info_list (), fcn_map (), method_map () { } |
5832 | 42 |
43 public: | |
44 | |
7336 | 45 typedef void (*hook_fcn_ptr) (const std::string& dir); |
5832 | 46 |
47 ~load_path (void) { } | |
48 | |
6365 | 49 static void initialize (bool set_initial_path = false) |
5832 | 50 { |
51 if (instance_ok ()) | |
6365 | 52 instance->do_initialize (set_initial_path); |
5832 | 53 } |
54 | |
55 static void clear (void) | |
56 { | |
57 if (instance_ok ()) | |
58 instance->do_clear (); | |
59 } | |
60 | |
5867 | 61 static void set (const std::string& p, bool warn = false) |
5832 | 62 { |
63 if (instance_ok ()) | |
5867 | 64 instance->do_set (p, warn); |
5832 | 65 } |
66 | |
5867 | 67 static void append (const std::string& dir, bool warn = false) |
5832 | 68 { |
69 if (instance_ok ()) | |
5867 | 70 instance->do_append (dir, warn); |
5832 | 71 } |
72 | |
5867 | 73 static void prepend (const std::string& dir, bool warn = false) |
5832 | 74 { |
75 if (instance_ok ()) | |
5867 | 76 instance->do_prepend (dir, warn); |
5832 | 77 } |
78 | |
79 static bool remove (const std::string& dir) | |
80 { | |
81 return instance_ok () ? instance->do_remove (dir) : false; | |
82 } | |
83 | |
84 static void update (void) | |
85 { | |
86 if (instance_ok ()) | |
87 instance->do_update (); | |
88 } | |
89 | |
7336 | 90 static std::string find_method (const std::string& class_name, |
91 const std::string& meth, | |
92 std::string& dir_name) | |
93 { | |
94 return instance_ok () | |
95 ? instance->do_find_method (class_name, meth, dir_name) : std::string (); | |
96 } | |
97 | |
98 static std::string find_method (const std::string& class_name, | |
99 const std::string& meth) | |
100 { | |
101 std::string dir_name; | |
102 return find_method (class_name, meth, dir_name); | |
103 } | |
104 | |
105 static std::list<std::string> methods (const std::string& class_name) | |
106 { | |
107 return instance_ok () | |
108 ? instance->do_methods (class_name) : std::list<std::string> (); | |
109 } | |
110 | |
9458
0c7d84a65386
allow taking handles of methods with no base overload
Jaroslav Hajek <highegg@gmail.com>
parents:
9261
diff
changeset
|
111 static bool any_class_method (const std::string& meth) |
0c7d84a65386
allow taking handles of methods with no base overload
Jaroslav Hajek <highegg@gmail.com>
parents:
9261
diff
changeset
|
112 { |
0c7d84a65386
allow taking handles of methods with no base overload
Jaroslav Hajek <highegg@gmail.com>
parents:
9261
diff
changeset
|
113 return instance_ok () |
0c7d84a65386
allow taking handles of methods with no base overload
Jaroslav Hajek <highegg@gmail.com>
parents:
9261
diff
changeset
|
114 ? instance->do_any_class_method (meth) : false; |
0c7d84a65386
allow taking handles of methods with no base overload
Jaroslav Hajek <highegg@gmail.com>
parents:
9261
diff
changeset
|
115 } |
0c7d84a65386
allow taking handles of methods with no base overload
Jaroslav Hajek <highegg@gmail.com>
parents:
9261
diff
changeset
|
116 |
7336 | 117 static std::string find_fcn (const std::string& fcn, std::string& dir_name) |
118 { | |
119 return instance_ok () | |
120 ? instance->do_find_fcn (fcn, dir_name) : std::string (); | |
121 } | |
122 | |
5832 | 123 static std::string find_fcn (const std::string& fcn) |
124 { | |
7336 | 125 std::string dir_name; |
126 return find_fcn (fcn, dir_name); | |
127 } | |
128 | |
129 static std::string find_private_fcn (const std::string& dir, | |
130 const std::string& fcn) | |
131 { | |
5832 | 132 return instance_ok () |
7336 | 133 ? instance->do_find_private_fcn (dir, fcn) : std::string (); |
5832 | 134 } |
135 | |
136 static std::string find_fcn_file (const std::string& fcn) | |
137 { | |
7336 | 138 std::string dir_name; |
139 | |
5832 | 140 return instance_ok () ? |
7336 | 141 instance->do_find_fcn (fcn, dir_name, M_FILE) : std::string (); |
5832 | 142 } |
143 | |
144 static std::string find_oct_file (const std::string& fcn) | |
145 { | |
7336 | 146 std::string dir_name; |
147 | |
5832 | 148 return instance_ok () ? |
7336 | 149 instance->do_find_fcn (fcn, dir_name, OCT_FILE) : std::string (); |
5832 | 150 } |
151 | |
5864 | 152 static std::string find_mex_file (const std::string& fcn) |
153 { | |
7336 | 154 std::string dir_name; |
155 | |
5864 | 156 return instance_ok () ? |
7336 | 157 instance->do_find_fcn (fcn, dir_name, MEX_FILE) : std::string (); |
5864 | 158 } |
159 | |
5832 | 160 static std::string find_file (const std::string& file) |
161 { | |
162 return instance_ok () | |
163 ? instance->do_find_file (file) : std::string (); | |
164 } | |
165 | |
8041
a14bdf90be55
Add a search for Contents.m files to the help function
David Bateman <dbateman@free.fr>
parents:
8008
diff
changeset
|
166 static std::string find_dir (const std::string& dir) |
a14bdf90be55
Add a search for Contents.m files to the help function
David Bateman <dbateman@free.fr>
parents:
8008
diff
changeset
|
167 { |
a14bdf90be55
Add a search for Contents.m files to the help function
David Bateman <dbateman@free.fr>
parents:
8008
diff
changeset
|
168 return instance_ok () |
a14bdf90be55
Add a search for Contents.m files to the help function
David Bateman <dbateman@free.fr>
parents:
8008
diff
changeset
|
169 ? instance->do_find_dir (dir) : std::string (); |
a14bdf90be55
Add a search for Contents.m files to the help function
David Bateman <dbateman@free.fr>
parents:
8008
diff
changeset
|
170 } |
a14bdf90be55
Add a search for Contents.m files to the help function
David Bateman <dbateman@free.fr>
parents:
8008
diff
changeset
|
171 |
5832 | 172 static std::string find_first_of (const string_vector& files) |
173 { | |
174 return instance_ok () ? | |
175 instance->do_find_first_of (files) : std::string (); | |
176 } | |
177 | |
178 static string_vector find_all_first_of (const string_vector& files) | |
179 { | |
180 return instance_ok () ? | |
181 instance->do_find_all_first_of (files) : string_vector (); | |
182 } | |
183 | |
184 static string_vector dirs (void) | |
185 { | |
186 return instance_ok () ? instance->do_dirs () : string_vector (); | |
187 } | |
188 | |
189 static std::list<std::string> dir_list (void) | |
190 { | |
191 return instance_ok () | |
192 ? instance->do_dir_list () : std::list<std::string> (); | |
193 } | |
194 | |
9261
95445f9f5976
omit file extensions from __list_functions__ output
John W. Eaton <jwe@octave.org>
parents:
9010
diff
changeset
|
195 static string_vector files (const std::string& dir, bool omit_exts = false) |
5832 | 196 { |
9261
95445f9f5976
omit file extensions from __list_functions__ output
John W. Eaton <jwe@octave.org>
parents:
9010
diff
changeset
|
197 return instance_ok () |
95445f9f5976
omit file extensions from __list_functions__ output
John W. Eaton <jwe@octave.org>
parents:
9010
diff
changeset
|
198 ? instance->do_files (dir, omit_exts) : string_vector (); |
5832 | 199 } |
200 | |
201 static string_vector fcn_names (void) | |
202 { | |
203 return instance_ok () ? instance->do_fcn_names () : string_vector (); | |
204 } | |
205 | |
206 static std::string path (void) | |
207 { | |
208 return instance_ok () ? instance->do_path () : std::string (); | |
209 } | |
210 | |
211 static void display (std::ostream& os) | |
212 { | |
213 if (instance_ok ()) | |
214 instance->do_display (os); | |
215 } | |
216 | |
7336 | 217 static void set_add_hook (hook_fcn_ptr f) { add_hook = f; } |
5832 | 218 |
7336 | 219 static void set_remove_hook (hook_fcn_ptr f) { remove_hook = f; } |
5832 | 220 |
221 static void set_command_line_path (const std::string& p) | |
222 { | |
5835 | 223 if (command_line_path.empty ()) |
224 command_line_path = p; | |
225 else | |
8008
4d13a7a2f6ab
dir_path: use singleton class for static data members
John W. Eaton <jwe@octave.org>
parents:
7971
diff
changeset
|
226 command_line_path += dir_path::path_sep_str () + p; |
5832 | 227 } |
228 | |
8586
31ab3b83bc8a
savepath: Respect cmd-line and env paths.
Ben Abbott <bpabbott@mac.com>
parents:
8329
diff
changeset
|
229 static std::string get_command_line_path (void) |
31ab3b83bc8a
savepath: Respect cmd-line and env paths.
Ben Abbott <bpabbott@mac.com>
parents:
8329
diff
changeset
|
230 { |
31ab3b83bc8a
savepath: Respect cmd-line and env paths.
Ben Abbott <bpabbott@mac.com>
parents:
8329
diff
changeset
|
231 return instance_ok () ? instance->do_get_command_line_path () : std::string (); |
31ab3b83bc8a
savepath: Respect cmd-line and env paths.
Ben Abbott <bpabbott@mac.com>
parents:
8329
diff
changeset
|
232 } |
31ab3b83bc8a
savepath: Respect cmd-line and env paths.
Ben Abbott <bpabbott@mac.com>
parents:
8329
diff
changeset
|
233 |
6626 | 234 static std::string system_path (void) |
235 { | |
6630 | 236 return instance_ok () ? instance->do_system_path () : std::string (); |
6626 | 237 } |
238 | |
5832 | 239 private: |
240 | |
241 static const int M_FILE = 1; | |
242 static const int OCT_FILE = 2; | |
5864 | 243 static const int MEX_FILE = 4; |
5832 | 244 |
245 class dir_info | |
246 { | |
247 public: | |
248 | |
7336 | 249 // <FCN_NAME, TYPE> |
250 typedef std::map<std::string, int> fcn_file_map_type; | |
251 | |
252 typedef fcn_file_map_type::const_iterator const_fcn_file_map_iterator; | |
253 typedef fcn_file_map_type::iterator fcn_file_map_iterator; | |
254 | |
7971
dd5cc5016487
handle private functions in class directories
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
255 struct class_info |
dd5cc5016487
handle private functions in class directories
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
256 { |
dd5cc5016487
handle private functions in class directories
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
257 fcn_file_map_type method_file_map; |
dd5cc5016487
handle private functions in class directories
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
258 fcn_file_map_type private_file_map; |
dd5cc5016487
handle private functions in class directories
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
259 }; |
dd5cc5016487
handle private functions in class directories
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
260 |
dd5cc5016487
handle private functions in class directories
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
261 // <CLASS_NAME, CLASS_INFO> |
dd5cc5016487
handle private functions in class directories
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
262 typedef std::map<std::string, class_info> method_file_map_type; |
7336 | 263 |
264 typedef method_file_map_type::const_iterator const_method_file_map_iterator; | |
265 typedef method_file_map_type::iterator method_file_map_iterator; | |
266 | |
8329
c91b59532f32
load-path.cc (load_path::dir_info::update): smarter handling of relative names
John W. Eaton <jwe@octave.org>
parents:
8041
diff
changeset
|
267 // This default constructor is only provided so we can create a |
c91b59532f32
load-path.cc (load_path::dir_info::update): smarter handling of relative names
John W. Eaton <jwe@octave.org>
parents:
8041
diff
changeset
|
268 // std::map of dir_info objects. You should not use this |
c91b59532f32
load-path.cc (load_path::dir_info::update): smarter handling of relative names
John W. Eaton <jwe@octave.org>
parents:
8041
diff
changeset
|
269 // constructor for any other purpose. |
c91b59532f32
load-path.cc (load_path::dir_info::update): smarter handling of relative names
John W. Eaton <jwe@octave.org>
parents:
8041
diff
changeset
|
270 dir_info (void) { } |
c91b59532f32
load-path.cc (load_path::dir_info::update): smarter handling of relative names
John W. Eaton <jwe@octave.org>
parents:
8041
diff
changeset
|
271 |
5832 | 272 dir_info (const std::string& d) : dir_name (d) { initialize (); } |
273 | |
274 dir_info (const dir_info& di) | |
8329
c91b59532f32
load-path.cc (load_path::dir_info::update): smarter handling of relative names
John W. Eaton <jwe@octave.org>
parents:
8041
diff
changeset
|
275 : dir_name (di.dir_name), abs_dir_name (di.abs_dir_name), |
c91b59532f32
load-path.cc (load_path::dir_info::update): smarter handling of relative names
John W. Eaton <jwe@octave.org>
parents:
8041
diff
changeset
|
276 is_relative (di.is_relative), |
5832 | 277 dir_mtime (di.dir_mtime), all_files (di.all_files), |
278 fcn_files (di.fcn_files), | |
7336 | 279 private_file_map (di.private_file_map), |
280 method_file_map (di.method_file_map) { } | |
5832 | 281 |
282 ~dir_info (void) { } | |
283 | |
284 dir_info& operator = (const dir_info& di) | |
285 { | |
286 if (&di != this) | |
287 { | |
288 dir_name = di.dir_name; | |
8329
c91b59532f32
load-path.cc (load_path::dir_info::update): smarter handling of relative names
John W. Eaton <jwe@octave.org>
parents:
8041
diff
changeset
|
289 abs_dir_name = di.abs_dir_name; |
5832 | 290 is_relative = di.is_relative; |
291 dir_mtime = di.dir_mtime; | |
292 all_files = di.all_files; | |
293 fcn_files = di.fcn_files; | |
7336 | 294 private_file_map = di.private_file_map; |
295 method_file_map = di.method_file_map; | |
5832 | 296 } |
297 | |
298 return *this; | |
299 } | |
300 | |
301 void update (void); | |
302 | |
303 std::string dir_name; | |
8329
c91b59532f32
load-path.cc (load_path::dir_info::update): smarter handling of relative names
John W. Eaton <jwe@octave.org>
parents:
8041
diff
changeset
|
304 std::string abs_dir_name; |
5832 | 305 bool is_relative; |
306 octave_time dir_mtime; | |
307 string_vector all_files; | |
308 string_vector fcn_files; | |
7336 | 309 fcn_file_map_type private_file_map; |
310 method_file_map_type method_file_map; | |
5832 | 311 |
312 private: | |
313 | |
314 void initialize (void); | |
315 | |
7336 | 316 void get_file_list (const std::string& d); |
317 | |
318 void get_private_file_map (const std::string& d); | |
5832 | 319 |
7336 | 320 void get_method_file_map (const std::string& d, |
321 const std::string& class_name); | |
322 | |
323 friend fcn_file_map_type get_fcn_files (const std::string& d); | |
5832 | 324 }; |
325 | |
326 class file_info | |
327 { | |
328 public: | |
329 | |
330 file_info (const std::string& d, int t) : dir_name (d), types (t) { } | |
331 | |
332 file_info (const file_info& fi) | |
333 : dir_name (fi.dir_name), types (fi.types) { } | |
334 | |
335 ~file_info (void) { } | |
336 | |
337 file_info& operator = (const file_info& fi) | |
338 { | |
339 if (&fi != this) | |
340 { | |
341 dir_name = fi.dir_name; | |
342 types = fi.types; | |
343 } | |
344 | |
345 return *this; | |
346 } | |
347 | |
348 std::string dir_name; | |
349 int types; | |
350 }; | |
351 | |
352 // We maintain two ways of looking at the same information. | |
353 // | |
354 // First, a list of directories and the set of "public" files and | |
355 // private files (those found in the special "private" subdirectory) | |
356 // in each directory. | |
357 // | |
358 // Second, a map from file names (the union of all "public" files for all | |
7336 | 359 // directories, but without filename extensions) to a list of |
5832 | 360 // corresponding information (directory name and file types). This |
361 // way, we can quickly find shadowed file names and look up all | |
362 // overloaded functions (in the "@" directories used to implement | |
363 // classes). | |
364 | |
7336 | 365 typedef std::list<dir_info> dir_info_list_type; |
366 | |
367 typedef dir_info_list_type::const_iterator const_dir_info_list_iterator; | |
368 typedef dir_info_list_type::iterator dir_info_list_iterator; | |
369 | |
8329
c91b59532f32
load-path.cc (load_path::dir_info::update): smarter handling of relative names
John W. Eaton <jwe@octave.org>
parents:
8041
diff
changeset
|
370 typedef std::map<std::string, dir_info> abs_dir_cache_type; |
c91b59532f32
load-path.cc (load_path::dir_info::update): smarter handling of relative names
John W. Eaton <jwe@octave.org>
parents:
8041
diff
changeset
|
371 |
c91b59532f32
load-path.cc (load_path::dir_info::update): smarter handling of relative names
John W. Eaton <jwe@octave.org>
parents:
8041
diff
changeset
|
372 typedef abs_dir_cache_type::const_iterator const_abs_dir_cache_iterator; |
c91b59532f32
load-path.cc (load_path::dir_info::update): smarter handling of relative names
John W. Eaton <jwe@octave.org>
parents:
8041
diff
changeset
|
373 typedef abs_dir_cache_type::iterator abs_dir_cache_iterator; |
c91b59532f32
load-path.cc (load_path::dir_info::update): smarter handling of relative names
John W. Eaton <jwe@octave.org>
parents:
8041
diff
changeset
|
374 |
7336 | 375 typedef std::list<file_info> file_info_list_type; |
376 | |
377 typedef file_info_list_type::const_iterator const_file_info_list_iterator; | |
378 typedef file_info_list_type::iterator file_info_list_iterator; | |
379 | |
380 // <FCN_NAME, FILE_INFO_LIST> | |
381 typedef std::map<std::string, file_info_list_type> fcn_map_type; | |
382 | |
383 typedef fcn_map_type::const_iterator const_fcn_map_iterator; | |
384 typedef fcn_map_type::iterator fcn_map_iterator; | |
5832 | 385 |
7336 | 386 // <DIR_NAME, <FCN_NAME, TYPE>> |
387 typedef std::map<std::string, dir_info::fcn_file_map_type> private_fcn_map_type; | |
388 | |
389 typedef private_fcn_map_type::const_iterator const_private_fcn_map_iterator; | |
390 typedef private_fcn_map_type::iterator private_fcn_map_iterator; | |
391 | |
392 // <CLASS_NAME, <FCN_NAME, FILE_INFO_LIST>> | |
393 typedef std::map<std::string, fcn_map_type> method_map_type; | |
394 | |
395 typedef method_map_type::const_iterator const_method_map_iterator; | |
396 typedef method_map_type::iterator method_map_iterator; | |
9010
f914834836e7
Partial implementation of derived classes using the old form with "@" files.
rtshort@smoketree.phaselocked.com
parents:
8950
diff
changeset
|
397 |
7336 | 398 mutable dir_info_list_type dir_info_list; |
399 | |
400 mutable fcn_map_type fcn_map; | |
401 | |
402 mutable private_fcn_map_type private_fcn_map; | |
403 | |
404 mutable method_map_type method_map; | |
5832 | 405 |
406 static load_path *instance; | |
407 | |
7336 | 408 static hook_fcn_ptr add_hook; |
5832 | 409 |
7336 | 410 static hook_fcn_ptr remove_hook; |
5832 | 411 |
412 static std::string command_line_path; | |
413 | |
6626 | 414 static std::string sys_path; |
415 | |
8329
c91b59532f32
load-path.cc (load_path::dir_info::update): smarter handling of relative names
John W. Eaton <jwe@octave.org>
parents:
8041
diff
changeset
|
416 static abs_dir_cache_type abs_dir_cache; |
c91b59532f32
load-path.cc (load_path::dir_info::update): smarter handling of relative names
John W. Eaton <jwe@octave.org>
parents:
8041
diff
changeset
|
417 |
5832 | 418 static bool instance_ok (void); |
419 | |
420 const_dir_info_list_iterator find_dir_info (const std::string& dir) const; | |
421 dir_info_list_iterator find_dir_info (const std::string& dir); | |
422 | |
423 bool contains (const std::string& dir) const; | |
424 | |
7336 | 425 void move_fcn_map (const std::string& dir, |
426 const string_vector& fcn_files, bool at_end); | |
427 | |
428 void move_method_map (const std::string& dir, bool at_end); | |
429 | |
5832 | 430 void move (std::list<dir_info>::iterator i, bool at_end); |
431 | |
6365 | 432 void do_initialize (bool set_initial_path); |
5832 | 433 |
434 void do_clear (void); | |
435 | |
5867 | 436 void do_set (const std::string& p, bool warn); |
437 | |
438 void do_append (const std::string& dir, bool warn); | |
5832 | 439 |
5867 | 440 void do_prepend (const std::string& dir, bool warn); |
5832 | 441 |
5867 | 442 void do_add (const std::string& dir, bool at_end, bool warn); |
5832 | 443 |
7336 | 444 void remove_fcn_map (const std::string& dir, const string_vector& fcn_files); |
445 | |
446 void remove_private_fcn_map (const std::string& dir); | |
447 | |
448 void remove_method_map (const std::string& dir); | |
449 | |
5832 | 450 bool do_remove (const std::string& dir); |
451 | |
452 void do_update (void) const; | |
453 | |
7336 | 454 static bool |
455 check_file_type (std::string& fname, int type, int possible_types, | |
456 const std::string& fcn, const char *who); | |
457 | |
5832 | 458 std::string do_find_fcn (const std::string& fcn, |
7336 | 459 std::string& dir_name, |
5864 | 460 int type = M_FILE | OCT_FILE | MEX_FILE) const; |
5832 | 461 |
7336 | 462 std::string do_find_private_fcn (const std::string& dir, |
463 const std::string& fcn, | |
464 int type = M_FILE | OCT_FILE | MEX_FILE) const; | |
465 | |
466 std::string do_find_method (const std::string& class_name, | |
467 const std::string& meth, | |
468 std::string& dir_name, | |
469 int type = M_FILE | OCT_FILE | MEX_FILE) const; | |
470 | |
471 std::list<std::string> do_methods (const std::string& class_name) const; | |
472 | |
9458
0c7d84a65386
allow taking handles of methods with no base overload
Jaroslav Hajek <highegg@gmail.com>
parents:
9261
diff
changeset
|
473 bool do_any_class_method (const std::string& meth) const; |
0c7d84a65386
allow taking handles of methods with no base overload
Jaroslav Hajek <highegg@gmail.com>
parents:
9261
diff
changeset
|
474 |
5832 | 475 std::string do_find_file (const std::string& file) const; |
476 | |
8041
a14bdf90be55
Add a search for Contents.m files to the help function
David Bateman <dbateman@free.fr>
parents:
8008
diff
changeset
|
477 std::string do_find_dir (const std::string& dir) const; |
a14bdf90be55
Add a search for Contents.m files to the help function
David Bateman <dbateman@free.fr>
parents:
8008
diff
changeset
|
478 |
5832 | 479 std::string do_find_first_of (const string_vector& files) const; |
480 | |
481 string_vector do_find_all_first_of (const string_vector& files) const; | |
482 | |
483 string_vector do_dirs (void) const; | |
484 | |
485 std::list<std::string> do_dir_list (void) const; | |
486 | |
9261
95445f9f5976
omit file extensions from __list_functions__ output
John W. Eaton <jwe@octave.org>
parents:
9010
diff
changeset
|
487 string_vector do_files (const std::string& dir, bool omit_exts) const; |
5832 | 488 |
489 string_vector do_fcn_names (void) const; | |
490 | |
491 std::string do_path (void) const; | |
492 | |
7336 | 493 friend void print_types (std::ostream& os, int types); |
494 | |
495 friend string_vector get_file_list (const dir_info::fcn_file_map_type& lst); | |
496 | |
497 friend void | |
498 print_fcn_list (std::ostream& os, const dir_info::fcn_file_map_type& lst); | |
499 | |
5832 | 500 void do_display (std::ostream& os) const; |
501 | |
6629 | 502 std::string do_system_path (void) const { return sys_path; } |
6626 | 503 |
8586
31ab3b83bc8a
savepath: Respect cmd-line and env paths.
Ben Abbott <bpabbott@mac.com>
parents:
8329
diff
changeset
|
504 std::string do_get_command_line_path (void) const { return command_line_path; } |
31ab3b83bc8a
savepath: Respect cmd-line and env paths.
Ben Abbott <bpabbott@mac.com>
parents:
8329
diff
changeset
|
505 |
5832 | 506 void add_to_fcn_map (const dir_info& di, bool at_end) const; |
7336 | 507 |
508 void add_to_private_fcn_map (const dir_info& di) const; | |
509 | |
510 void add_to_method_map (const dir_info& di, bool at_end) const; | |
511 | |
512 friend dir_info::fcn_file_map_type get_fcn_files (const std::string& d); | |
5832 | 513 }; |
514 | |
515 extern std::string | |
516 genpath (const std::string& dir, const string_vector& skip = "private"); | |
517 | |
518 extern void execute_pkg_add (const std::string& dir); | |
519 extern void execute_pkg_del (const std::string& dir); | |
520 | |
521 #endif | |
522 | |
523 /* | |
524 ;;; Local Variables: *** | |
525 ;;; mode: C++ *** | |
526 ;;; page-delimiter: "^/\\*" *** | |
527 ;;; End: *** | |
528 */ |