Mercurial > octave-libgccjit
annotate libinterp/corefcn/load-path.h @ 18905:82773ee8119a
Fix ambiguous Matrix initialization from csetdf972b9d080a
* graphics.cc (default_patch_x/ydata): explicitly use decimal numbers to initialize Matrices to double values
author | Pantxo Diribarne <pantxo.diribarne@gmail.com> |
---|---|
date | Thu, 10 Jul 2014 09:52:49 +0200 |
parents | 97e49b588f5d |
children |
rev | line source |
---|---|
5832 | 1 /* |
2 | |
17744
d63878346099
maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents:
16892
diff
changeset
|
3 Copyright (C) 2006-2013 John W. Eaton |
10521
4d1fc073fbb7
add some missing copyright stmts
Jaroslav Hajek <highegg@gmail.com>
parents:
10321
diff
changeset
|
4 Copyright (C) 2010 VZLU Prague |
5832 | 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 | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
5832 | 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 | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
5832 | 21 |
22 */ | |
23 | |
24 #if !defined (octave_load_path_h) | |
25 #define octave_load_path_h 1 | |
26 | |
8950
d865363208d6
include <iosfwd> instead of <iostream> in header files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
27 #include <iosfwd> |
5832 | 28 #include <list> |
29 #include <map> | |
30 #include <string> | |
31 | |
5835 | 32 #include "pathsearch.h" |
5832 | 33 #include "str-vec.h" |
34 | |
35 class | |
6241 | 36 OCTINTERP_API |
5832 | 37 load_path |
38 { | |
39 protected: | |
40 | |
9010
f914834836e7
Partial implementation of derived classes using the old form with "@" files.
rtshort@smoketree.phaselocked.com
parents:
8950
diff
changeset
|
41 load_path (void) |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
42 : loader_map (), default_loader (), dir_info_list (), init_dirs () { } |
5832 | 43 |
44 public: | |
45 | |
7336 | 46 typedef void (*hook_fcn_ptr) (const std::string& dir); |
5832 | 47 |
48 ~load_path (void) { } | |
49 | |
6365 | 50 static void initialize (bool set_initial_path = false) |
5832 | 51 { |
52 if (instance_ok ()) | |
6365 | 53 instance->do_initialize (set_initial_path); |
5832 | 54 } |
55 | |
56 static void clear (void) | |
57 { | |
58 if (instance_ok ()) | |
15008
ff9a638a5555
preserve order of path elements when doing "path (new_path)"
John W. Eaton <jwe@octave.org>
parents:
14861
diff
changeset
|
59 instance->do_clear (); |
5832 | 60 } |
61 | |
5867 | 62 static void set (const std::string& p, bool warn = false) |
5832 | 63 { |
64 if (instance_ok ()) | |
5867 | 65 instance->do_set (p, warn); |
5832 | 66 } |
67 | |
5867 | 68 static void append (const std::string& dir, bool warn = false) |
5832 | 69 { |
70 if (instance_ok ()) | |
5867 | 71 instance->do_append (dir, warn); |
5832 | 72 } |
73 | |
5867 | 74 static void prepend (const std::string& dir, bool warn = false) |
5832 | 75 { |
76 if (instance_ok ()) | |
5867 | 77 instance->do_prepend (dir, warn); |
5832 | 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 | |
16547
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
91 static bool contains_canonical (const std::string& dir_name) |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
92 { |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
93 return instance_ok () ? instance->do_contains_canonical (dir_name) : false; |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
94 } |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
95 |
7336 | 96 static std::string find_method (const std::string& class_name, |
10313 | 97 const std::string& meth, |
16684
edbb123cbe3a
Correct handling of package context in symbol table.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16676
diff
changeset
|
98 std::string& dir_name, |
edbb123cbe3a
Correct handling of package context in symbol table.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16676
diff
changeset
|
99 const std::string& pack_name = std::string ()) |
7336 | 100 { |
101 return instance_ok () | |
16684
edbb123cbe3a
Correct handling of package context in symbol table.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16676
diff
changeset
|
102 ? instance->get_loader (pack_name).find_method (class_name, meth, |
edbb123cbe3a
Correct handling of package context in symbol table.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16676
diff
changeset
|
103 dir_name) |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
104 : std::string (); |
7336 | 105 } |
106 | |
107 static std::string find_method (const std::string& class_name, | |
16684
edbb123cbe3a
Correct handling of package context in symbol table.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16676
diff
changeset
|
108 const std::string& meth, |
edbb123cbe3a
Correct handling of package context in symbol table.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16676
diff
changeset
|
109 const std::string& pack_name = std::string ()) |
7336 | 110 { |
111 std::string dir_name; | |
16684
edbb123cbe3a
Correct handling of package context in symbol table.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16676
diff
changeset
|
112 return find_method (class_name, meth, dir_name, pack_name); |
7336 | 113 } |
114 | |
16684
edbb123cbe3a
Correct handling of package context in symbol table.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16676
diff
changeset
|
115 static std::list<std::string> methods (const std::string& class_name, |
edbb123cbe3a
Correct handling of package context in symbol table.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16676
diff
changeset
|
116 const std::string& pack_name = std::string ()) |
7336 | 117 { |
118 return instance_ok () | |
16684
edbb123cbe3a
Correct handling of package context in symbol table.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16676
diff
changeset
|
119 ? instance->get_loader(pack_name).methods (class_name) |
edbb123cbe3a
Correct handling of package context in symbol table.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16676
diff
changeset
|
120 : std::list<std::string> (); |
7336 | 121 } |
122 | |
10321
97b4bd6f0925
partially rewrite function handles
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
123 static std::list<std::string> overloads (const std::string& meth) |
9458
0c7d84a65386
allow taking handles of methods with no base overload
Jaroslav Hajek <highegg@gmail.com>
parents:
9261
diff
changeset
|
124 { |
0c7d84a65386
allow taking handles of methods with no base overload
Jaroslav Hajek <highegg@gmail.com>
parents:
9261
diff
changeset
|
125 return instance_ok () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
126 ? instance->do_overloads (meth) : std::list<std::string> (); |
9458
0c7d84a65386
allow taking handles of methods with no base overload
Jaroslav Hajek <highegg@gmail.com>
parents:
9261
diff
changeset
|
127 } |
0c7d84a65386
allow taking handles of methods with no base overload
Jaroslav Hajek <highegg@gmail.com>
parents:
9261
diff
changeset
|
128 |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
129 static bool find_package (const std::string& package_name) |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
130 { |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
131 return instance_ok () |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
132 ? instance->do_find_package (package_name) : false; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
133 } |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
134 |
16690
1c45e22fc444
Implement meta.package.getAllPackages() method.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16684
diff
changeset
|
135 static std::list<std::string> |
1c45e22fc444
Implement meta.package.getAllPackages() method.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16684
diff
changeset
|
136 get_all_package_names (bool only_top_level = true) |
7336 | 137 { |
138 return instance_ok () | |
16690
1c45e22fc444
Implement meta.package.getAllPackages() method.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16684
diff
changeset
|
139 ? instance->do_get_all_package_names (only_top_level) |
1c45e22fc444
Implement meta.package.getAllPackages() method.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16684
diff
changeset
|
140 : std::list<std::string> (); |
7336 | 141 } |
142 | |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
143 static std::string find_fcn (const std::string& fcn, std::string& dir_name, |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
144 const std::string& pack_name = std::string ()) |
7336 | 145 { |
146 return instance_ok () | |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
147 ? instance->get_loader (pack_name).find_fcn (fcn, dir_name) |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
148 : std::string (); |
7336 | 149 } |
150 | |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
151 static std::string find_fcn (const std::string& fcn, |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
152 const std::string& pack_name = std::string ()) |
5832 | 153 { |
7336 | 154 std::string dir_name; |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
155 return find_fcn (fcn, dir_name, pack_name); |
7336 | 156 } |
157 | |
158 static std::string find_private_fcn (const std::string& dir, | |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
159 const std::string& fcn, |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
160 const std::string& pack_name = std::string ()) |
7336 | 161 { |
5832 | 162 return instance_ok () |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
163 ? instance->get_loader (pack_name).find_private_fcn (dir, fcn) |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
164 : std::string (); |
5832 | 165 } |
166 | |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
167 static std::string find_fcn_file (const std::string& fcn, |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
168 const std::string& pack_name = std::string ()) |
5832 | 169 { |
7336 | 170 std::string dir_name; |
171 | |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
172 return instance_ok () |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
173 ? instance->get_loader (pack_name).find_fcn (fcn, dir_name, M_FILE) |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
174 : std::string (); |
5832 | 175 } |
176 | |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
177 static std::string find_oct_file (const std::string& fcn, |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
178 const std::string& pack_name = std::string ()) |
5832 | 179 { |
7336 | 180 std::string dir_name; |
181 | |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
182 return instance_ok () |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
183 ? instance->get_loader (pack_name).find_fcn (fcn, dir_name, M_FILE) |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
184 : std::string (); |
5832 | 185 } |
186 | |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
187 static std::string find_mex_file (const std::string& fcn, |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
188 const std::string& pack_name = std::string ()) |
5864 | 189 { |
7336 | 190 std::string dir_name; |
191 | |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
192 return instance_ok () |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
193 ? instance->get_loader (pack_name).find_fcn (fcn, dir_name, M_FILE) |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
194 : std::string (); |
5864 | 195 } |
196 | |
5832 | 197 static std::string find_file (const std::string& file) |
198 { | |
199 return instance_ok () | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
200 ? instance->do_find_file (file) : std::string (); |
5832 | 201 } |
202 | |
8041
a14bdf90be55
Add a search for Contents.m files to the help function
David Bateman <dbateman@free.fr>
parents:
8008
diff
changeset
|
203 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
|
204 { |
a14bdf90be55
Add a search for Contents.m files to the help function
David Bateman <dbateman@free.fr>
parents:
8008
diff
changeset
|
205 return instance_ok () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
206 ? instance->do_find_dir (dir) : std::string (); |
8041
a14bdf90be55
Add a search for Contents.m files to the help function
David Bateman <dbateman@free.fr>
parents:
8008
diff
changeset
|
207 } |
a14bdf90be55
Add a search for Contents.m files to the help function
David Bateman <dbateman@free.fr>
parents:
8008
diff
changeset
|
208 |
9806
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9748
diff
changeset
|
209 static string_vector find_matching_dirs (const std::string& dir) |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9748
diff
changeset
|
210 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9748
diff
changeset
|
211 return instance_ok () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
212 ? instance->do_find_matching_dirs (dir) : string_vector (); |
9806
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9748
diff
changeset
|
213 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9748
diff
changeset
|
214 |
5832 | 215 static std::string find_first_of (const string_vector& files) |
216 { | |
217 return instance_ok () ? | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
218 instance->do_find_first_of (files) : std::string (); |
5832 | 219 } |
220 | |
221 static string_vector find_all_first_of (const string_vector& files) | |
222 { | |
223 return instance_ok () ? | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
224 instance->do_find_all_first_of (files) : string_vector (); |
5832 | 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 () | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
235 ? instance->do_dir_list () : std::list<std::string> (); |
5832 | 236 } |
237 | |
9261
95445f9f5976
omit file extensions from __list_functions__ output
John W. Eaton <jwe@octave.org>
parents:
9010
diff
changeset
|
238 static string_vector files (const std::string& dir, bool omit_exts = false) |
5832 | 239 { |
9261
95445f9f5976
omit file extensions from __list_functions__ output
John W. Eaton <jwe@octave.org>
parents:
9010
diff
changeset
|
240 return instance_ok () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
241 ? instance->do_files (dir, omit_exts) : string_vector (); |
5832 | 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 | |
7336 | 260 static void set_add_hook (hook_fcn_ptr f) { add_hook = f; } |
5832 | 261 |
7336 | 262 static void set_remove_hook (hook_fcn_ptr f) { remove_hook = f; } |
5832 | 263 |
264 static void set_command_line_path (const std::string& p) | |
265 { | |
5835 | 266 if (command_line_path.empty ()) |
267 command_line_path = p; | |
268 else | |
8008
4d13a7a2f6ab
dir_path: use singleton class for static data members
John W. Eaton <jwe@octave.org>
parents:
7971
diff
changeset
|
269 command_line_path += dir_path::path_sep_str () + p; |
5832 | 270 } |
271 | |
8586
31ab3b83bc8a
savepath: Respect cmd-line and env paths.
Ben Abbott <bpabbott@mac.com>
parents:
8329
diff
changeset
|
272 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
|
273 { |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
274 return instance_ok () ? instance->do_get_command_line_path () |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
275 : std::string (); |
8586
31ab3b83bc8a
savepath: Respect cmd-line and env paths.
Ben Abbott <bpabbott@mac.com>
parents:
8329
diff
changeset
|
276 } |
31ab3b83bc8a
savepath: Respect cmd-line and env paths.
Ben Abbott <bpabbott@mac.com>
parents:
8329
diff
changeset
|
277 |
6626 | 278 static std::string system_path (void) |
279 { | |
6630 | 280 return instance_ok () ? instance->do_system_path () : std::string (); |
6626 | 281 } |
282 | |
5832 | 283 private: |
284 | |
285 static const int M_FILE = 1; | |
286 static const int OCT_FILE = 2; | |
5864 | 287 static const int MEX_FILE = 4; |
5832 | 288 |
289 class dir_info | |
290 { | |
291 public: | |
292 | |
7336 | 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 | |
7971
dd5cc5016487
handle private functions in class directories
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
299 struct class_info |
dd5cc5016487
handle private functions in class directories
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
300 { |
11515
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
301 class_info (void) : method_file_map (), private_file_map () { } |
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
302 |
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
303 class_info (const class_info& ci) |
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
304 : method_file_map (ci.method_file_map), |
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
305 private_file_map (ci.private_file_map) { } |
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
306 |
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
307 class_info& operator = (const class_info& ci) |
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
308 { |
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
309 if (this != &ci) |
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
310 { |
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
311 method_file_map = ci.method_file_map; |
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
312 private_file_map = ci.private_file_map; |
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
313 } |
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
314 return *this; |
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
315 } |
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
316 |
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
317 ~class_info (void) { } |
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
318 |
7971
dd5cc5016487
handle private functions in class directories
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
319 fcn_file_map_type method_file_map; |
dd5cc5016487
handle private functions in class directories
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
320 fcn_file_map_type private_file_map; |
dd5cc5016487
handle private functions in class directories
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
321 }; |
dd5cc5016487
handle private functions in class directories
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
322 |
dd5cc5016487
handle private functions in class directories
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
323 // <CLASS_NAME, CLASS_INFO> |
dd5cc5016487
handle private functions in class directories
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
324 typedef std::map<std::string, class_info> method_file_map_type; |
7336 | 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 | |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
329 // <PACKAGE_NAME, DIR_INFO> |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
330 typedef std::map<std::string, dir_info> package_dir_map_type; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
331 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
332 typedef package_dir_map_type::const_iterator const_package_dir_map_iterator; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
333 typedef package_dir_map_type::iterator package_dir_map_iterator; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
334 |
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
|
335 // 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
|
336 // 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
|
337 // constructor for any other purpose. |
11515
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
338 dir_info (void) |
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
339 : dir_name (), abs_dir_name (), is_relative (false), |
15008
ff9a638a5555
preserve order of path elements when doing "path (new_path)"
John W. Eaton <jwe@octave.org>
parents:
14861
diff
changeset
|
340 dir_mtime (), dir_time_last_checked (), |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
341 all_files (), fcn_files (), private_file_map (), method_file_map (), |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
342 package_dir_map () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
343 { } |
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
|
344 |
11515
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
345 dir_info (const std::string& d) |
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
346 : dir_name (d), abs_dir_name (), is_relative (false), |
15008
ff9a638a5555
preserve order of path elements when doing "path (new_path)"
John W. Eaton <jwe@octave.org>
parents:
14861
diff
changeset
|
347 dir_mtime (), dir_time_last_checked (), |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
348 all_files (), fcn_files (), private_file_map (), method_file_map (), |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
349 package_dir_map () |
11515
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
350 { |
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
351 initialize (); |
6dbf9bcce90e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10907
diff
changeset
|
352 } |
5832 | 353 |
354 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
|
355 : dir_name (di.dir_name), abs_dir_name (di.abs_dir_name), |
10313 | 356 is_relative (di.is_relative), |
357 dir_mtime (di.dir_mtime), | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
358 dir_time_last_checked (di.dir_time_last_checked), |
10313 | 359 all_files (di.all_files), fcn_files (di.fcn_files), |
360 private_file_map (di.private_file_map), | |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
361 method_file_map (di.method_file_map), |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
362 package_dir_map (di.package_dir_map) { } |
5832 | 363 |
364 ~dir_info (void) { } | |
365 | |
366 dir_info& operator = (const dir_info& di) | |
367 { | |
368 if (&di != this) | |
10313 | 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; | |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
379 package_dir_map = di.package_dir_map; |
10313 | 380 } |
5832 | 381 |
382 return *this; | |
383 } | |
384 | |
385 void update (void); | |
386 | |
387 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
|
388 std::string abs_dir_name; |
5832 | 389 bool is_relative; |
390 octave_time dir_mtime; | |
9748
d6b2b708b6b0
load-path: compare directory timestamps with tolerance
John W. Eaton <jwe@octave.org>
parents:
9581
diff
changeset
|
391 octave_time dir_time_last_checked; |
5832 | 392 string_vector all_files; |
393 string_vector fcn_files; | |
7336 | 394 fcn_file_map_type private_file_map; |
395 method_file_map_type method_file_map; | |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
396 package_dir_map_type package_dir_map; |
5832 | 397 |
398 private: | |
399 | |
400 void initialize (void); | |
401 | |
7336 | 402 void get_file_list (const std::string& d); |
403 | |
404 void get_private_file_map (const std::string& d); | |
5832 | 405 |
7336 | 406 void get_method_file_map (const std::string& d, |
10313 | 407 const std::string& class_name); |
7336 | 408 |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
409 void get_package_dir (const std::string& d, |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
410 const std::string& package_name); |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
411 |
7336 | 412 friend fcn_file_map_type get_fcn_files (const std::string& d); |
5832 | 413 }; |
414 | |
415 class file_info | |
416 { | |
417 public: | |
418 | |
419 file_info (const std::string& d, int t) : dir_name (d), types (t) { } | |
420 | |
421 file_info (const file_info& fi) | |
422 : dir_name (fi.dir_name), types (fi.types) { } | |
423 | |
424 ~file_info (void) { } | |
425 | |
426 file_info& operator = (const file_info& fi) | |
427 { | |
428 if (&fi != this) | |
10313 | 429 { |
430 dir_name = fi.dir_name; | |
431 types = fi.types; | |
432 } | |
5832 | 433 |
434 return *this; | |
435 } | |
436 | |
437 std::string dir_name; | |
438 int types; | |
439 }; | |
440 | |
441 // We maintain two ways of looking at the same information. | |
442 // | |
443 // First, a list of directories and the set of "public" files and | |
444 // private files (those found in the special "private" subdirectory) | |
445 // in each directory. | |
446 // | |
447 // Second, a map from file names (the union of all "public" files for all | |
7336 | 448 // directories, but without filename extensions) to a list of |
5832 | 449 // corresponding information (directory name and file types). This |
450 // way, we can quickly find shadowed file names and look up all | |
451 // overloaded functions (in the "@" directories used to implement | |
452 // classes). | |
453 | |
7336 | 454 typedef std::list<dir_info> dir_info_list_type; |
455 | |
456 typedef dir_info_list_type::const_iterator const_dir_info_list_iterator; | |
457 typedef dir_info_list_type::iterator dir_info_list_iterator; | |
458 | |
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
|
459 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
|
460 |
c91b59532f32
load-path.cc (load_path::dir_info::update): smarter handling of relative names
John W. Eaton <jwe@octave.org>
parents:
8041
diff
changeset
|
461 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
|
462 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
|
463 |
7336 | 464 typedef std::list<file_info> file_info_list_type; |
465 | |
466 typedef file_info_list_type::const_iterator const_file_info_list_iterator; | |
467 typedef file_info_list_type::iterator file_info_list_iterator; | |
468 | |
469 // <FCN_NAME, FILE_INFO_LIST> | |
470 typedef std::map<std::string, file_info_list_type> fcn_map_type; | |
471 | |
472 typedef fcn_map_type::const_iterator const_fcn_map_iterator; | |
473 typedef fcn_map_type::iterator fcn_map_iterator; | |
5832 | 474 |
7336 | 475 // <DIR_NAME, <FCN_NAME, TYPE>> |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
476 typedef std::map<std::string, dir_info::fcn_file_map_type> |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
477 private_fcn_map_type; |
7336 | 478 |
479 typedef private_fcn_map_type::const_iterator const_private_fcn_map_iterator; | |
480 typedef private_fcn_map_type::iterator private_fcn_map_iterator; | |
481 | |
482 // <CLASS_NAME, <FCN_NAME, FILE_INFO_LIST>> | |
483 typedef std::map<std::string, fcn_map_type> method_map_type; | |
484 | |
485 typedef method_map_type::const_iterator const_method_map_iterator; | |
486 typedef method_map_type::iterator method_map_iterator; | |
10907
6105ed2db9d7
load_path::dir_info::initialize: clear method_file_map before updating file list
John W. Eaton <jwe@octave.org>
parents:
10521
diff
changeset
|
487 |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
488 class loader |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
489 { |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
490 public: |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
491 loader (const std::string& pfx = std::string ()) |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
492 : prefix (pfx), dir_list (), fcn_map (), private_fcn_map (), |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
493 method_map () { } |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
494 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
495 loader (const loader& l) |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
496 : prefix (l.prefix), dir_list (l.dir_list), |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
497 private_fcn_map (l.private_fcn_map), method_map (l.method_map) { } |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
498 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
499 ~loader (void) { } |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
500 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
501 loader& operator = (const loader& l) |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
502 { |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
503 if (&l != this) |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
504 { |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
505 prefix = l.prefix; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
506 dir_list = l.dir_list; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
507 fcn_map = l.fcn_map; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
508 private_fcn_map = l.private_fcn_map; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
509 method_map = l.method_map; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
510 } |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
511 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
512 return *this; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
513 } |
7336 | 514 |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
515 void add (const dir_info& di, bool at_end) |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
516 { |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
517 if (at_end) |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
518 dir_list.push_back (di.dir_name); |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
519 else |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
520 dir_list.push_front (di.dir_name); |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
521 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
522 add_to_fcn_map (di, at_end); |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
523 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
524 add_to_private_fcn_map (di); |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
525 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
526 add_to_method_map (di, at_end); |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
527 } |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
528 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
529 void move (const dir_info& di, bool at_end); |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
530 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
531 void remove (const dir_info& di); |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
532 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
533 void clear (void) |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
534 { |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
535 dir_list.clear (); |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
536 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
537 fcn_map.clear (); |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
538 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
539 private_fcn_map.clear (); |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
540 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
541 method_map.clear (); |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
542 } |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
543 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
544 void display (std::ostream& out) const; |
7336 | 545 |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
546 std::string find_fcn (const std::string& fcn, |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
547 std::string& dir_name, |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
548 int type = M_FILE | OCT_FILE | MEX_FILE) const; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
549 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
550 std::string find_private_fcn (const std::string& dir, |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
551 const std::string& fcn, |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
552 int type = M_FILE | OCT_FILE | MEX_FILE) const; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
553 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
554 std::string find_method (const std::string& class_name, |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
555 const std::string& meth, |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
556 std::string& dir_name, |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
557 int type = M_FILE | OCT_FILE | MEX_FILE) const; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
558 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
559 std::list<std::string> methods (const std::string& class_name) const; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
560 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
561 void overloads (const std::string& meth, std::list<std::string>& l) const; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
562 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
563 string_vector fcn_names (void) const; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
564 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
565 private: |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
566 void add_to_fcn_map (const dir_info& di, bool at_end); |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
567 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
568 void add_to_private_fcn_map (const dir_info& di); |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
569 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
570 void add_to_method_map (const dir_info& di, bool at_end); |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
571 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
572 void move_fcn_map (const std::string& dir, |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
573 const string_vector& fcn_files, bool at_end); |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
574 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
575 void move_method_map (const std::string& dir, bool at_end); |
7336 | 576 |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
577 void remove_fcn_map (const std::string& dir, |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
578 const string_vector& fcn_files); |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
579 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
580 void remove_private_fcn_map (const std::string& dir); |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
581 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
582 void remove_method_map (const std::string& dir); |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
583 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
584 private: |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
585 std::string prefix; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
586 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
587 std::list<std::string> dir_list; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
588 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
589 fcn_map_type fcn_map; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
590 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
591 private_fcn_map_type private_fcn_map; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
592 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
593 method_map_type method_map; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
594 }; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
595 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
596 // <PACKAGE_NAME, LOADER> |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
597 typedef std::map<std::string, loader> loader_map_type; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
598 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
599 typedef loader_map_type::const_iterator const_loader_map_iterator; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
600 typedef loader_map_type::iterator loader_map_iterator; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
601 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
602 mutable loader_map_type loader_map; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
603 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
604 mutable loader default_loader; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
605 |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
606 mutable dir_info_list_type dir_info_list; |
5832 | 607 |
15008
ff9a638a5555
preserve order of path elements when doing "path (new_path)"
John W. Eaton <jwe@octave.org>
parents:
14861
diff
changeset
|
608 mutable std::set<std::string> init_dirs; |
ff9a638a5555
preserve order of path elements when doing "path (new_path)"
John W. Eaton <jwe@octave.org>
parents:
14861
diff
changeset
|
609 |
5832 | 610 static load_path *instance; |
611 | |
13983
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
612 static void cleanup_instance (void) { delete instance; instance = 0; } |
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
613 |
7336 | 614 static hook_fcn_ptr add_hook; |
5832 | 615 |
7336 | 616 static hook_fcn_ptr remove_hook; |
5832 | 617 |
618 static std::string command_line_path; | |
619 | |
6626 | 620 static std::string sys_path; |
621 | |
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
|
622 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
|
623 |
5832 | 624 static bool instance_ok (void); |
625 | |
626 const_dir_info_list_iterator find_dir_info (const std::string& dir) const; | |
627 dir_info_list_iterator find_dir_info (const std::string& dir); | |
628 | |
629 bool contains (const std::string& dir) const; | |
630 | |
16547
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
631 bool do_contains_canonical (const std::string& dir) const; |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
632 |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
633 void do_move (dir_info_list_iterator i, bool at_end); |
7336 | 634 |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
635 void move (const dir_info& di, bool at_end, |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
636 const std::string& pname = std::string ()); |
7336 | 637 |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
638 void remove (const dir_info& di, |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
639 const std::string& pname = std::string ()); |
5832 | 640 |
6365 | 641 void do_initialize (bool set_initial_path); |
5832 | 642 |
15008
ff9a638a5555
preserve order of path elements when doing "path (new_path)"
John W. Eaton <jwe@octave.org>
parents:
14861
diff
changeset
|
643 void do_clear (void); |
5832 | 644 |
15008
ff9a638a5555
preserve order of path elements when doing "path (new_path)"
John W. Eaton <jwe@octave.org>
parents:
14861
diff
changeset
|
645 void do_set (const std::string& p, bool warn, bool is_init = false); |
5867 | 646 |
15008
ff9a638a5555
preserve order of path elements when doing "path (new_path)"
John W. Eaton <jwe@octave.org>
parents:
14861
diff
changeset
|
647 void do_append (const std::string& dir, bool warn); |
5832 | 648 |
5867 | 649 void do_prepend (const std::string& dir, bool warn); |
5832 | 650 |
15008
ff9a638a5555
preserve order of path elements when doing "path (new_path)"
John W. Eaton <jwe@octave.org>
parents:
14861
diff
changeset
|
651 void do_add (const std::string& dir, bool at_end, bool warn); |
5832 | 652 |
653 bool do_remove (const std::string& dir); | |
654 | |
655 void do_update (void) const; | |
656 | |
7336 | 657 static bool |
658 check_file_type (std::string& fname, int type, int possible_types, | |
10313 | 659 const std::string& fcn, const char *who); |
7336 | 660 |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
661 loader& get_loader (const std::string& name) const |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
662 { |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
663 if (! name.empty ()) |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
664 { |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
665 loader_map_iterator l = loader_map.find (name); |
5832 | 666 |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
667 if (l == loader_map.end ()) |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
668 l = loader_map.insert (loader_map.end (), |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
669 loader_map_type::value_type (name, loader (name))); |
7336 | 670 |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
671 return l->second; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
672 } |
7336 | 673 |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
674 return default_loader; |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
675 } |
7336 | 676 |
10321
97b4bd6f0925
partially rewrite function handles
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
677 std::list<std::string> do_overloads (const std::string& meth) const; |
9458
0c7d84a65386
allow taking handles of methods with no base overload
Jaroslav Hajek <highegg@gmail.com>
parents:
9261
diff
changeset
|
678 |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
679 bool do_find_package (const std::string& package_name) const |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
680 { |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
681 return (loader_map.find (package_name) != loader_map.end ()); |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
682 } |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
683 |
16690
1c45e22fc444
Implement meta.package.getAllPackages() method.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16684
diff
changeset
|
684 std::list<std::string> do_get_all_package_names (bool only_top_level) const; |
1c45e22fc444
Implement meta.package.getAllPackages() method.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16684
diff
changeset
|
685 |
5832 | 686 std::string do_find_file (const std::string& file) const; |
687 | |
8041
a14bdf90be55
Add a search for Contents.m files to the help function
David Bateman <dbateman@free.fr>
parents:
8008
diff
changeset
|
688 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
|
689 |
9806
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9748
diff
changeset
|
690 string_vector do_find_matching_dirs (const std::string& dir) const; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9748
diff
changeset
|
691 |
5832 | 692 std::string do_find_first_of (const string_vector& files) const; |
693 | |
694 string_vector do_find_all_first_of (const string_vector& files) const; | |
695 | |
696 string_vector do_dirs (void) const; | |
697 | |
698 std::list<std::string> do_dir_list (void) const; | |
699 | |
9261
95445f9f5976
omit file extensions from __list_functions__ output
John W. Eaton <jwe@octave.org>
parents:
9010
diff
changeset
|
700 string_vector do_files (const std::string& dir, bool omit_exts) const; |
5832 | 701 |
702 string_vector do_fcn_names (void) const; | |
703 | |
704 std::string do_path (void) const; | |
705 | |
7336 | 706 friend void print_types (std::ostream& os, int types); |
707 | |
708 friend string_vector get_file_list (const dir_info::fcn_file_map_type& lst); | |
709 | |
710 friend void | |
711 print_fcn_list (std::ostream& os, const dir_info::fcn_file_map_type& lst); | |
712 | |
5832 | 713 void do_display (std::ostream& os) const; |
714 | |
6629 | 715 std::string do_system_path (void) const { return sys_path; } |
6626 | 716 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
717 std::string do_get_command_line_path (void) const |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
718 { return command_line_path; } |
8586
31ab3b83bc8a
savepath: Respect cmd-line and env paths.
Ben Abbott <bpabbott@mac.com>
parents:
8329
diff
changeset
|
719 |
16676
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
720 void add (const dir_info& di, bool at_end, |
7368654f302f
Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16547
diff
changeset
|
721 const std::string& pname = std::string ()) const; |
7336 | 722 |
723 friend dir_info::fcn_file_map_type get_fcn_files (const std::string& d); | |
5832 | 724 }; |
725 | |
726 extern std::string | |
727 genpath (const std::string& dir, const string_vector& skip = "private"); | |
728 | |
729 extern void execute_pkg_add (const std::string& dir); | |
730 extern void execute_pkg_del (const std::string& dir); | |
731 | |
732 #endif |