GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
load-path.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2006-2015 John W. Eaton
4 Copyright (C) 2010 VZLU Prague
5 
6 This file is part of Octave.
7 
8 Octave is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the
10 Free Software Foundation; either version 3 of the License, or (at your
11 option) any later version.
12 
13 Octave is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with Octave; see the file COPYING. If not, see
20 <http://www.gnu.org/licenses/>.
21 
22 */
23 
24 #if !defined (octave_load_path_h)
25 #define octave_load_path_h 1
26 
27 #include <iosfwd>
28 #include <list>
29 #include <map>
30 #include <string>
31 
32 #include "pathsearch.h"
33 #include "str-vec.h"
34 
35 class
38 {
39 protected:
40 
41  load_path (void)
42  : loader_map (), default_loader (), dir_info_list (), init_dirs () { }
43 
44 public:
45 
46  typedef void (*hook_fcn_ptr) (const std::string& dir);
47 
48  ~load_path (void) { }
49 
50  static void initialize (bool set_initial_path = false)
51  {
52  if (instance_ok ())
53  instance->do_initialize (set_initial_path);
54  }
55 
56  static void clear (void)
57  {
58  if (instance_ok ())
59  instance->do_clear ();
60  }
61 
62  static void set (const std::string& p, bool warn = false)
63  {
64  if (instance_ok ())
65  instance->do_set (p, warn);
66  }
67 
68  static void append (const std::string& dir, bool warn = false)
69  {
70  if (instance_ok ())
71  instance->do_append (dir, warn);
72  }
73 
74  static void prepend (const std::string& dir, bool warn = false)
75  {
76  if (instance_ok ())
77  instance->do_prepend (dir, warn);
78  }
79 
80  static bool remove (const std::string& dir)
81  {
82  return instance_ok () ? instance->do_remove (dir) : false;
83  }
84 
85  static void update (void)
86  {
87  if (instance_ok ())
88  instance->do_update ();
89  }
90 
91  static bool contains_canonical (const std::string& dir_name)
92  {
93  return instance_ok () ? instance->do_contains_canonical (dir_name) : false;
94  }
95 
96  static std::string find_method (const std::string& class_name,
97  const std::string& meth,
98  std::string& dir_name,
99  const std::string& pack_name = std::string ())
100  {
101  return instance_ok ()
102  ? instance->get_loader (pack_name).find_method (class_name, meth,
103  dir_name)
104  : std::string ();
105  }
106 
107  static std::string find_method (const std::string& class_name,
108  const std::string& meth,
109  const std::string& pack_name = std::string ())
110  {
111  std::string dir_name;
112  return find_method (class_name, meth, dir_name, pack_name);
113  }
114 
115  static std::list<std::string> methods (const std::string& class_name,
116  const std::string& pack_name = std::string ())
117  {
118  return instance_ok ()
119  ? instance->get_loader(pack_name).methods (class_name)
120  : std::list<std::string> ();
121  }
122 
123  static std::list<std::string> overloads (const std::string& meth)
124  {
125  return instance_ok ()
126  ? instance->do_overloads (meth) : std::list<std::string> ();
127  }
128 
129  static bool find_package (const std::string& package_name)
130  {
131  return instance_ok ()
132  ? instance->do_find_package (package_name) : false;
133  }
134 
135  static std::list<std::string>
136  get_all_package_names (bool only_top_level = true)
137  {
138  return instance_ok ()
139  ? instance->do_get_all_package_names (only_top_level)
140  : std::list<std::string> ();
141  }
142 
143  static std::string find_fcn (const std::string& fcn, std::string& dir_name,
144  const std::string& pack_name = std::string ())
145  {
146  return instance_ok ()
147  ? instance->get_loader (pack_name).find_fcn (fcn, dir_name)
148  : std::string ();
149  }
150 
151  static std::string find_fcn (const std::string& fcn,
152  const std::string& pack_name = std::string ())
153  {
154  std::string dir_name;
155  return find_fcn (fcn, dir_name, pack_name);
156  }
157 
158  static std::string find_private_fcn (const std::string& dir,
159  const std::string& fcn,
160  const std::string& pack_name = std::string ())
161  {
162  return instance_ok ()
163  ? instance->get_loader (pack_name).find_private_fcn (dir, fcn)
164  : std::string ();
165  }
166 
167  static std::string find_fcn_file (const std::string& fcn,
168  const std::string& pack_name = std::string ())
169  {
170  std::string dir_name;
171 
172  return instance_ok ()
173  ? instance->get_loader (pack_name).find_fcn (fcn, dir_name, M_FILE)
174  : std::string ();
175  }
176 
177  static std::string find_oct_file (const std::string& fcn,
178  const std::string& pack_name = std::string ())
179  {
180  std::string dir_name;
181 
182  return instance_ok ()
183  ? instance->get_loader (pack_name).find_fcn (fcn, dir_name, M_FILE)
184  : std::string ();
185  }
186 
187  static std::string find_mex_file (const std::string& fcn,
188  const std::string& pack_name = std::string ())
189  {
190  std::string dir_name;
191 
192  return instance_ok ()
193  ? instance->get_loader (pack_name).find_fcn (fcn, dir_name, M_FILE)
194  : std::string ();
195  }
196 
197  static std::string find_file (const std::string& file)
198  {
199  return instance_ok ()
200  ? instance->do_find_file (file) : std::string ();
201  }
202 
203  static std::string find_dir (const std::string& dir)
204  {
205  return instance_ok ()
206  ? instance->do_find_dir (dir) : std::string ();
207  }
208 
209  static string_vector find_matching_dirs (const std::string& dir)
210  {
211  return instance_ok ()
212  ? instance->do_find_matching_dirs (dir) : string_vector ();
213  }
214 
215  static std::string find_first_of (const string_vector& files)
216  {
217  return instance_ok () ?
218  instance->do_find_first_of (files) : std::string ();
219  }
220 
222  {
223  return instance_ok () ?
224  instance->do_find_all_first_of (files) : string_vector ();
225  }
226 
227  static string_vector dirs (void)
228  {
229  return instance_ok () ? instance->do_dirs () : string_vector ();
230  }
231 
232  static std::list<std::string> dir_list (void)
233  {
234  return instance_ok ()
235  ? instance->do_dir_list () : std::list<std::string> ();
236  }
237 
238  static string_vector files (const std::string& dir, bool omit_exts = false)
239  {
240  return instance_ok ()
241  ? instance->do_files (dir, omit_exts) : string_vector ();
242  }
243 
244  static string_vector fcn_names (void)
245  {
246  return instance_ok () ? instance->do_fcn_names () : string_vector ();
247  }
248 
249  static std::string path (void)
250  {
251  return instance_ok () ? instance->do_path () : std::string ();
252  }
253 
254  static void display (std::ostream& os)
255  {
256  if (instance_ok ())
257  instance->do_display (os);
258  }
259 
260  static void set_add_hook (hook_fcn_ptr f) { add_hook = f; }
261 
262  static void set_remove_hook (hook_fcn_ptr f) { remove_hook = f; }
263 
264  static void set_command_line_path (const std::string& p)
265  {
266  if (command_line_path.empty ())
267  command_line_path = p;
268  else
270  }
271 
272  static std::string get_command_line_path (void)
273  {
274  return instance_ok () ? instance->do_get_command_line_path ()
275  : std::string ();
276  }
277 
278  static std::string system_path (void)
279  {
280  return instance_ok () ? instance->do_system_path () : std::string ();
281  }
282 
283 private:
284 
285  static const int M_FILE = 1;
286  static const int OCT_FILE = 2;
287  static const int MEX_FILE = 4;
288 
289  class dir_info
290  {
291  public:
292 
293  // <FCN_NAME, TYPE>
294  typedef std::map<std::string, int> fcn_file_map_type;
295 
296  typedef fcn_file_map_type::const_iterator const_fcn_file_map_iterator;
297  typedef fcn_file_map_type::iterator fcn_file_map_iterator;
298 
299  struct class_info
300  {
301  class_info (void) : method_file_map (), private_file_map () { }
302 
303  class_info (const class_info& ci)
304  : method_file_map (ci.method_file_map),
305  private_file_map (ci.private_file_map) { }
306 
307  class_info& operator = (const class_info& ci)
308  {
309  if (this != &ci)
310  {
311  method_file_map = ci.method_file_map;
312  private_file_map = ci.private_file_map;
313  }
314  return *this;
315  }
316 
317  ~class_info (void) { }
318 
319  fcn_file_map_type method_file_map;
320  fcn_file_map_type private_file_map;
321  };
322 
323  // <CLASS_NAME, CLASS_INFO>
324  typedef std::map<std::string, class_info> method_file_map_type;
325 
326  typedef method_file_map_type::const_iterator const_method_file_map_iterator;
327  typedef method_file_map_type::iterator method_file_map_iterator;
328 
329  // <PACKAGE_NAME, DIR_INFO>
330  typedef std::map<std::string, dir_info> package_dir_map_type;
331 
332  typedef package_dir_map_type::const_iterator const_package_dir_map_iterator;
333  typedef package_dir_map_type::iterator package_dir_map_iterator;
334 
335  // This default constructor is only provided so we can create a
336  // std::map of dir_info objects. You should not use this
337  // constructor for any other purpose.
338  dir_info (void)
339  : dir_name (), abs_dir_name (), is_relative (false),
340  dir_mtime (), dir_time_last_checked (),
341  all_files (), fcn_files (), private_file_map (), method_file_map (),
342  package_dir_map ()
343  { }
344 
345  dir_info (const std::string& d)
346  : dir_name (d), abs_dir_name (), is_relative (false),
347  dir_mtime (), dir_time_last_checked (),
348  all_files (), fcn_files (), private_file_map (), method_file_map (),
349  package_dir_map ()
350  {
351  initialize ();
352  }
353 
354  dir_info (const dir_info& di)
355  : dir_name (di.dir_name), abs_dir_name (di.abs_dir_name),
356  is_relative (di.is_relative),
357  dir_mtime (di.dir_mtime),
358  dir_time_last_checked (di.dir_time_last_checked),
359  all_files (di.all_files), fcn_files (di.fcn_files),
360  private_file_map (di.private_file_map),
361  method_file_map (di.method_file_map),
362  package_dir_map (di.package_dir_map) { }
363 
364  ~dir_info (void) { }
365 
366  dir_info& operator = (const dir_info& di)
367  {
368  if (&di != this)
369  {
370  dir_name = di.dir_name;
371  abs_dir_name = di.abs_dir_name;
372  is_relative = di.is_relative;
373  dir_mtime = di.dir_mtime;
374  dir_time_last_checked = di.dir_time_last_checked;
375  all_files = di.all_files;
376  fcn_files = di.fcn_files;
377  private_file_map = di.private_file_map;
378  method_file_map = di.method_file_map;
379  package_dir_map = di.package_dir_map;
380  }
381 
382  return *this;
383  }
384 
385  void update (void);
386 
387  std::string dir_name;
388  std::string abs_dir_name;
394  fcn_file_map_type private_file_map;
395  method_file_map_type method_file_map;
396  package_dir_map_type package_dir_map;
397 
398  bool is_package (const std::string& name) const;
399 
400  private:
401 
402  void initialize (void);
403 
404  void get_file_list (const std::string& d);
405 
406  void get_private_file_map (const std::string& d);
407 
408  void get_method_file_map (const std::string& d,
409  const std::string& class_name);
410 
411  void get_package_dir (const std::string& d,
412  const std::string& package_name);
413 
414  friend fcn_file_map_type get_fcn_files (const std::string& d);
415  };
416 
417  class file_info
418  {
419  public:
420 
421  file_info (const std::string& d, int t) : dir_name (d), types (t) { }
422 
424  : dir_name (fi.dir_name), types (fi.types) { }
425 
426  ~file_info (void) { }
427 
428  file_info& operator = (const file_info& fi)
429  {
430  if (&fi != this)
431  {
432  dir_name = fi.dir_name;
433  types = fi.types;
434  }
435 
436  return *this;
437  }
438 
439  std::string dir_name;
440  int types;
441  };
442 
443  // We maintain two ways of looking at the same information.
444  //
445  // First, a list of directories and the set of "public" files and
446  // private files (those found in the special "private" subdirectory)
447  // in each directory.
448  //
449  // Second, a map from file names (the union of all "public" files for all
450  // directories, but without filename extensions) to a list of
451  // corresponding information (directory name and file types). This
452  // way, we can quickly find shadowed file names and look up all
453  // overloaded functions (in the "@" directories used to implement
454  // classes).
455 
456  typedef std::list<dir_info> dir_info_list_type;
457 
458  typedef dir_info_list_type::const_iterator const_dir_info_list_iterator;
459  typedef dir_info_list_type::iterator dir_info_list_iterator;
460 
461  typedef std::map<std::string, dir_info> abs_dir_cache_type;
462 
463  typedef abs_dir_cache_type::const_iterator const_abs_dir_cache_iterator;
464  typedef abs_dir_cache_type::iterator abs_dir_cache_iterator;
465 
466  typedef std::list<file_info> file_info_list_type;
467 
468  typedef file_info_list_type::const_iterator const_file_info_list_iterator;
469  typedef file_info_list_type::iterator file_info_list_iterator;
470 
471  // <FCN_NAME, FILE_INFO_LIST>
472  typedef std::map<std::string, file_info_list_type> fcn_map_type;
473 
474  typedef fcn_map_type::const_iterator const_fcn_map_iterator;
475  typedef fcn_map_type::iterator fcn_map_iterator;
476 
477  // <DIR_NAME, <FCN_NAME, TYPE>>
478  typedef std::map<std::string, dir_info::fcn_file_map_type>
480 
481  typedef private_fcn_map_type::const_iterator const_private_fcn_map_iterator;
482  typedef private_fcn_map_type::iterator private_fcn_map_iterator;
483 
484  // <CLASS_NAME, <FCN_NAME, FILE_INFO_LIST>>
485  typedef std::map<std::string, fcn_map_type> method_map_type;
486 
487  typedef method_map_type::const_iterator const_method_map_iterator;
488  typedef method_map_type::iterator method_map_iterator;
489 
490  class loader
491  {
492  public:
493  loader (const std::string& pfx = std::string ())
494  : prefix (pfx), dir_list (), fcn_map (), private_fcn_map (),
495  method_map () { }
496 
497  loader (const loader& l)
498  : prefix (l.prefix), dir_list (l.dir_list),
499  private_fcn_map (l.private_fcn_map), method_map (l.method_map) { }
500 
501  ~loader (void) { }
502 
503  loader& operator = (const loader& l)
504  {
505  if (&l != this)
506  {
507  prefix = l.prefix;
508  dir_list = l.dir_list;
509  fcn_map = l.fcn_map;
510  private_fcn_map = l.private_fcn_map;
511  method_map = l.method_map;
512  }
513 
514  return *this;
515  }
516 
517  void add (const dir_info& di, bool at_end)
518  {
519  if (at_end)
520  dir_list.push_back (di.dir_name);
521  else
522  dir_list.push_front (di.dir_name);
523 
524  add_to_fcn_map (di, at_end);
525 
526  add_to_private_fcn_map (di);
527 
528  add_to_method_map (di, at_end);
529  }
530 
531  void move (const dir_info& di, bool at_end);
532 
533  void remove (const dir_info& di);
534 
535  void clear (void)
536  {
537  dir_list.clear ();
538 
539  fcn_map.clear ();
540 
541  private_fcn_map.clear ();
542 
543  method_map.clear ();
544  }
545 
546  void display (std::ostream& out) const;
547 
548  std::string find_fcn (const std::string& fcn,
549  std::string& dir_name,
550  int type = M_FILE | OCT_FILE | MEX_FILE) const;
551 
552  std::string find_private_fcn (const std::string& dir,
553  const std::string& fcn,
554  int type = M_FILE | OCT_FILE | MEX_FILE) const;
555 
556  std::string find_method (const std::string& class_name,
557  const std::string& meth,
558  std::string& dir_name,
559  int type = M_FILE | OCT_FILE | MEX_FILE) const;
560 
561  std::list<std::string> methods (const std::string& class_name) const;
562 
563  void overloads (const std::string& meth, std::list<std::string>& l) const;
564 
565  string_vector fcn_names (void) const;
566 
567  private:
568  void add_to_fcn_map (const dir_info& di, bool at_end);
569 
570  void add_to_private_fcn_map (const dir_info& di);
571 
572  void add_to_method_map (const dir_info& di, bool at_end);
573 
574  void move_fcn_map (const std::string& dir,
575  const string_vector& fcn_files, bool at_end);
576 
577  void move_method_map (const std::string& dir, bool at_end);
578 
579  void remove_fcn_map (const std::string& dir,
580  const string_vector& fcn_files);
581 
582  void remove_private_fcn_map (const std::string& dir);
583 
584  void remove_method_map (const std::string& dir);
585 
586  private:
587  std::string prefix;
588 
589  std::list<std::string> dir_list;
590 
591  fcn_map_type fcn_map;
592 
594 
595  method_map_type method_map;
596  };
597 
598  // <PACKAGE_NAME, LOADER>
599  typedef std::map<std::string, loader> loader_map_type;
600 
601  typedef loader_map_type::const_iterator const_loader_map_iterator;
602  typedef loader_map_type::iterator loader_map_iterator;
603 
604  mutable loader_map_type loader_map;
605 
607 
608  mutable dir_info_list_type dir_info_list;
609 
610  mutable std::set<std::string> init_dirs;
611 
613 
614  static void cleanup_instance (void) { delete instance; instance = 0; }
615 
616  static hook_fcn_ptr add_hook;
617 
618  static hook_fcn_ptr remove_hook;
619 
620  static std::string command_line_path;
621 
622  static std::string sys_path;
623 
624  static abs_dir_cache_type abs_dir_cache;
625 
626  static bool instance_ok (void);
627 
628  const_dir_info_list_iterator find_dir_info (const std::string& dir) const;
629  dir_info_list_iterator find_dir_info (const std::string& dir);
630 
631  bool contains (const std::string& dir) const;
632 
633  bool do_contains_canonical (const std::string& dir) const;
634 
635  void do_move (dir_info_list_iterator i, bool at_end);
636 
637  void move (const dir_info& di, bool at_end,
638  const std::string& pname = std::string ());
639 
640  void remove (const dir_info& di,
641  const std::string& pname = std::string ());
642 
643  void do_initialize (bool set_initial_path);
644 
645  void do_clear (void);
646 
647  void do_set (const std::string& p, bool warn, bool is_init = false);
648 
649  void do_append (const std::string& dir, bool warn);
650 
651  void do_prepend (const std::string& dir, bool warn);
652 
653  void do_add (const std::string& dir, bool at_end, bool warn);
654 
655  bool do_remove (const std::string& dir);
656 
657  void do_update (void) const;
658 
659  static bool
660  check_file_type (std::string& fname, int type, int possible_types,
661  const std::string& fcn, const char *who);
662 
663  bool is_package (const std::string& name) const;
664 
665  loader& get_loader (const std::string& name) const
666  {
667  if (! name.empty () && is_package (name))
668  {
669  loader_map_iterator l = loader_map.find (name);
670 
671  if (l == loader_map.end ())
672  l = loader_map.insert (loader_map.end (),
673  loader_map_type::value_type (name, loader (name)));
674 
675  return l->second;
676  }
677 
678  return default_loader;
679  }
680 
681  std::list<std::string> do_overloads (const std::string& meth) const;
682 
683  bool do_find_package (const std::string& package_name) const
684  {
685  return (loader_map.find (package_name) != loader_map.end ());
686  }
687 
688  std::list<std::string> do_get_all_package_names (bool only_top_level) const;
689 
690  std::string do_find_file (const std::string& file) const;
691 
692  std::string do_find_dir (const std::string& dir) const;
693 
694  string_vector do_find_matching_dirs (const std::string& dir) const;
695 
696  std::string do_find_first_of (const string_vector& files) const;
697 
698  string_vector do_find_all_first_of (const string_vector& files) const;
699 
700  string_vector do_dirs (void) const;
701 
702  std::list<std::string> do_dir_list (void) const;
703 
704  string_vector do_files (const std::string& dir, bool omit_exts) const;
705 
706  string_vector do_fcn_names (void) const;
707 
708  std::string do_path (void) const;
709 
710  friend void print_types (std::ostream& os, int types);
711 
712  friend string_vector get_file_list (const dir_info::fcn_file_map_type& lst);
713 
714  friend void
715  print_fcn_list (std::ostream& os, const dir_info::fcn_file_map_type& lst);
716 
717  void do_display (std::ostream& os) const;
718 
719  std::string do_system_path (void) const { return sys_path; }
720 
721  std::string do_get_command_line_path (void) const
722  { return command_line_path; }
723 
724  void add (const dir_info& di, bool at_end,
725  const std::string& pname = std::string ()) const;
726 
727  friend dir_info::fcn_file_map_type get_fcn_files (const std::string& d);
728 };
729 
730 extern std::string
731 genpath (const std::string& dir, const string_vector& skip = "private");
732 
733 extern void execute_pkg_add (const std::string& dir);
734 extern void execute_pkg_del (const std::string& dir);
735 
736 #endif
fcn_map_type::iterator fcn_map_iterator
Definition: load-path.h:475
std::string do_get_command_line_path(void) const
Definition: load-path.h:721
static std::string system_path(void)
Definition: load-path.h:278
std::set< std::string > init_dirs
Definition: load-path.h:610
method_file_map_type method_file_map
Definition: load-path.h:395
static string_vector find_matching_dirs(const std::string &dir)
Definition: load-path.h:209
fcn_file_map_type private_file_map
Definition: load-path.h:394
static std::string find_private_fcn(const std::string &dir, const std::string &fcn, const std::string &pack_name=std::string())
Definition: load-path.h:158
file_info(const std::string &d, int t)
Definition: load-path.h:421
method_map_type::iterator method_map_iterator
Definition: load-path.h:488
static void display(std::ostream &os)
Definition: load-path.h:254
std::map< std::string, fcn_map_type > method_map_type
Definition: load-path.h:485
static std::string path_sep_str(void)
Definition: pathsearch.h:95
static void prepend(const std::string &dir, bool warn=false)
Definition: load-path.h:74
std::map< std::string, int > fcn_file_map_type
Definition: load-path.h:294
static std::string command_line_path
Definition: load-path.h:620
dir_info_list_type::iterator dir_info_list_iterator
Definition: load-path.h:459
static void append(const std::string &dir, bool warn=false)
Definition: load-path.h:68
std::map< std::string, loader > loader_map_type
Definition: load-path.h:599
std::map< std::string, dir_info > package_dir_map_type
Definition: load-path.h:330
octave_time dir_mtime
Definition: load-path.h:390
static std::string find_fcn(const std::string &fcn, std::string &dir_name, const std::string &pack_name=std::string())
Definition: load-path.h:143
loader & get_loader(const std::string &name) const
Definition: load-path.h:665
std::string genpath(const std::string &dir, const string_vector &skip="private")
Definition: load-path.cc:2141
static std::string find_file(const std::string &file)
Definition: load-path.h:197
static std::string find_first_of(const string_vector &files)
Definition: load-path.h:215
file_info_list_type::const_iterator const_file_info_list_iterator
Definition: load-path.h:468
fcn_file_map_type private_file_map
Definition: load-path.h:320
dir_info_list_type dir_info_list
Definition: load-path.h:608
std::string do_system_path(void) const
Definition: load-path.h:719
private_fcn_map_type::const_iterator const_private_fcn_map_iterator
Definition: load-path.h:481
static abs_dir_cache_type abs_dir_cache
Definition: load-path.h:624
private_fcn_map_type::iterator private_fcn_map_iterator
Definition: load-path.h:482
package_dir_map_type::iterator package_dir_map_iterator
Definition: load-path.h:333
static void set_command_line_path(const std::string &p)
Definition: load-path.h:264
static std::string find_mex_file(const std::string &fcn, const std::string &pack_name=std::string())
Definition: load-path.h:187
std::string dir_name
Definition: load-path.h:387
method_map_type::const_iterator const_method_map_iterator
Definition: load-path.h:487
static string_vector files(const std::string &dir, bool omit_exts=false)
Definition: load-path.h:238
void print_fcn_list(std::ostream &os, const load_path::dir_info::fcn_file_map_type &lst)
Definition: load-path.cc:1759
void execute_pkg_add(const std::string &dir)
Definition: load-path.cc:2220
~load_path(void)
Definition: load-path.h:48
load_path(void)
Definition: load-path.h:41
F77_RET_T const double const double double * d
octave_time dir_time_last_checked
Definition: load-path.h:391
static std::string find_method(const std::string &class_name, const std::string &meth, const std::string &pack_name=std::string())
Definition: load-path.h:107
void execute_pkg_del(const std::string &dir)
Definition: load-path.cc:2226
method_file_map_type::iterator method_file_map_iterator
Definition: load-path.h:327
static std::string find_oct_file(const std::string &fcn, const std::string &pack_name=std::string())
Definition: load-path.h:177
string_vector fcn_files
Definition: load-path.h:393
static hook_fcn_ptr remove_hook
Definition: load-path.h:618
std::list< file_info > file_info_list_type
Definition: load-path.h:466
static void cleanup_instance(void)
Definition: load-path.h:614
static std::list< std::string > command_line_path
Definition: octave.cc:146
static string_vector fcn_names(void)
Definition: load-path.h:244
method_map_type method_map
Definition: load-path.h:595
std::map< std::string, file_info_list_type > fcn_map_type
Definition: load-path.h:472
std::list< std::string > dir_list
Definition: load-path.h:589
F77_RET_T const double const double * f
#define OCTINTERP_API
Definition: mexproto.h:66
static hook_fcn_ptr add_hook
Definition: load-path.h:616
loader(const std::string &pfx=std::string())
Definition: load-path.h:493
string_vector get_file_list(const load_path::dir_info::fcn_file_map_type &lst)
Definition: load-path.cc:1775
private_fcn_map_type private_fcn_map
Definition: load-path.h:593
fcn_file_map_type::const_iterator const_fcn_file_map_iterator
Definition: load-path.h:296
static std::string sys_path
Definition: load-path.h:622
std::string dir_name
Definition: load-path.h:439
std::map< std::string, dir_info > abs_dir_cache_type
Definition: load-path.h:461
void add(const dir_info &di, bool at_end)
Definition: load-path.h:517
static void initialize(bool set_initial_path=false)
Definition: load-path.h:50
class_info(const class_info &ci)
Definition: load-path.h:303
fcn_map_type fcn_map
Definition: load-path.h:591
loader default_loader
Definition: load-path.h:606
dir_info_list_type::const_iterator const_dir_info_list_iterator
Definition: load-path.h:458
static std::string find_method(const std::string &class_name, const std::string &meth, std::string &dir_name, const std::string &pack_name=std::string())
Definition: load-path.h:96
std::list< dir_info > dir_info_list_type
Definition: load-path.h:456
static bool contains_canonical(const std::string &dir_name)
Definition: load-path.h:91
file_info_list_type::iterator file_info_list_iterator
Definition: load-path.h:469
loader_map_type::iterator loader_map_iterator
Definition: load-path.h:602
abs_dir_cache_type::iterator abs_dir_cache_iterator
Definition: load-path.h:464
package_dir_map_type::const_iterator const_package_dir_map_iterator
Definition: load-path.h:332
static load_path * instance
Definition: load-path.h:612
load_path::dir_info::fcn_file_map_type get_fcn_files(const std::string &d)
Definition: load-path.cc:243
static std::list< std::string > methods(const std::string &class_name, const std::string &pack_name=std::string())
Definition: load-path.h:115
static std::string find_fcn_file(const std::string &fcn, const std::string &pack_name=std::string())
Definition: load-path.h:167
method_file_map_type::const_iterator const_method_file_map_iterator
Definition: load-path.h:326
void print_types(std::ostream &os, int types)
Definition: load-path.cc:1731
static bool set_initial_path
Definition: octave.cc:118
static std::list< std::string > overloads(const std::string &meth)
Definition: load-path.h:123
static void update(void)
Definition: load-path.h:85
file_info(const file_info &fi)
Definition: load-path.h:423
dir_info(const std::string &d)
Definition: load-path.h:345
abs_dir_cache_type::const_iterator const_abs_dir_cache_iterator
Definition: load-path.h:463
fcn_map_type::const_iterator const_fcn_map_iterator
Definition: load-path.h:474
static double fi[256]
Definition: randmtzig.c:443
std::string abs_dir_name
Definition: load-path.h:388
fcn_file_map_type method_file_map
Definition: load-path.h:319
static string_vector dirs(void)
Definition: load-path.h:227
fcn_file_map_type::iterator fcn_file_map_iterator
Definition: load-path.h:297
static std::list< std::string > dir_list(void)
Definition: load-path.h:232
bool do_find_package(const std::string &package_name) const
Definition: load-path.h:683
static void set_remove_hook(hook_fcn_ptr f)
Definition: load-path.h:262
static std::string find_dir(const std::string &dir)
Definition: load-path.h:203
string_vector all_files
Definition: load-path.h:392
package_dir_map_type package_dir_map
Definition: load-path.h:396
static std::string find_fcn(const std::string &fcn, const std::string &pack_name=std::string())
Definition: load-path.h:151
loader_map_type::const_iterator const_loader_map_iterator
Definition: load-path.h:601
static void set(const std::string &p, bool warn=false)
Definition: load-path.h:62
static std::string get_command_line_path(void)
Definition: load-path.h:272
loader_map_type loader_map
Definition: load-path.h:604
static void initialize(void)
Definition: mkoctfile.cc:111
void clear(void)
Definition: load-path.h:535
loader(const loader &l)
Definition: load-path.h:497
std::map< std::string, dir_info::fcn_file_map_type > private_fcn_map_type
Definition: load-path.h:479
static void clear(void)
Definition: load-path.h:56
static std::string path(void)
Definition: load-path.h:249
std::map< std::string, class_info > method_file_map_type
Definition: load-path.h:324
static string_vector find_all_first_of(const string_vector &files)
Definition: load-path.h:221
static bool find_package(const std::string &package_name)
Definition: load-path.h:129
static std::list< std::string > get_all_package_names(bool only_top_level=true)
Definition: load-path.h:136
static void set_add_hook(hook_fcn_ptr f)
Definition: load-path.h:260
dir_info(const dir_info &di)
Definition: load-path.h:354
std::string prefix
Definition: load-path.h:587