annotate src/load-path.h @ 9261:95445f9f5976

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