Mercurial > octave
annotate liboctave/util/pathsearch.h @ 25147:5960fd1b56f1
remove C++ functions, classes, and typdefs deprecated in version 4.2
* error.cc, error.h, gl2ps-print.h, mxarray.in.h, sighandlers.h,
utils.cc, utils.h, lo-mappers.h, lo-specfun.h, dir-ops.h, file-ops.h,
file-stat.h, lo-sysdep.h, oct-env.h, oct-group.h, oct-passwd.h,
oct-syscalls.h, oct-time.h, oct-uname.h, cmd-edit.h, cmd-hist.h,
lo-array-errwarn.h, lo-regexp.h, oct-glob.h, oct-inttypes.h,
oct-shlib.h, pathsearch.h, quit.h, unwind-prot.h, url-transfer.h):
Delete functions, classes, and typedefs deprecated in version 4.2.
* quit.cc (octave_throw_exit_exception): Throw octave::exit_exception,
not octave_exit_exception.
* gripes.h, gripes.cc: Delete.
* libinterp/corefcn/module.mk: Update
* lo-array-gripes.h, lo-array-gripes.cc: Delete.
* liboctave/util/module.mk: Update.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 07 Apr 2018 10:59:11 -0400 |
parents | 6652d3823428 |
children | 94fc8648f0fe |
rev | line source |
---|---|
1786 | 1 /* |
2 | |
25054
6652d3823428
maint: Update copyright dates in all source files.
John W. Eaton <jwe@octave.org>
parents:
24991
diff
changeset
|
3 Copyright (C) 1996-2018 John W. Eaton |
1786 | 4 |
5 This file is part of Octave. | |
6 | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23743
diff
changeset
|
7 Octave is free software: you can redistribute it and/or modify it |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22402
diff
changeset
|
8 under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23743
diff
changeset
|
9 the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22402
diff
changeset
|
10 (at your option) any later version. |
1786 | 11 |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22402
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22402
diff
changeset
|
13 WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22402
diff
changeset
|
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22402
diff
changeset
|
15 GNU General Public License for more details. |
1786 | 16 |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23743
diff
changeset
|
19 <https://www.gnu.org/licenses/>. |
1786 | 20 |
21 */ | |
22 | |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
23 #if ! defined (octave_pathsearch_h) |
1786 | 24 #define octave_pathsearch_h 1 |
25 | |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21017
diff
changeset
|
26 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21017
diff
changeset
|
27 |
21867
0cdfd6d230e6
use std::list<std::string> instead of string_vector in pathsearch functions
John W. Eaton <jwe@octave.org>
parents:
21752
diff
changeset
|
28 #include <list> |
1786 | 29 #include <string> |
30 | |
21745
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
31 namespace octave |
1786 | 32 { |
21745
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
33 class |
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
34 OCTAVE_API |
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
35 directory_path |
8008
4d13a7a2f6ab
dir_path: use singleton class for static data members
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
36 { |
4d13a7a2f6ab
dir_path: use singleton class for static data members
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
37 public: |
4d13a7a2f6ab
dir_path: use singleton class for static data members
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
38 |
23743
e919cc8d9d92
don't use singleton pattern in pathsearch class; treat pathsep as constant
John W. Eaton <jwe@octave.org>
parents:
23615
diff
changeset
|
39 directory_path (const std::string& s = "", const std::string& d = ""); |
21745
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
40 |
24991
831389905438
omit argument name from default copy ctors and assignment operators
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
41 directory_path (const directory_path&) = default; |
21745
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
42 |
24991
831389905438
omit argument name from default copy ctors and assignment operators
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
43 directory_path& operator = (const directory_path&) = default; |
21745
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
44 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
45 ~directory_path (void) = default; |
21745
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
46 |
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
47 void set (const std::string& s) |
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
48 { |
21867
0cdfd6d230e6
use std::list<std::string> instead of string_vector in pathsearch functions
John W. Eaton <jwe@octave.org>
parents:
21752
diff
changeset
|
49 m_initialized = false; |
0cdfd6d230e6
use std::list<std::string> instead of string_vector in pathsearch functions
John W. Eaton <jwe@octave.org>
parents:
21752
diff
changeset
|
50 m_orig_path = s; |
21745
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
51 init (); |
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
52 } |
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
53 |
21867
0cdfd6d230e6
use std::list<std::string> instead of string_vector in pathsearch functions
John W. Eaton <jwe@octave.org>
parents:
21752
diff
changeset
|
54 std::list<std::string> elements (void); |
0cdfd6d230e6
use std::list<std::string> instead of string_vector in pathsearch functions
John W. Eaton <jwe@octave.org>
parents:
21752
diff
changeset
|
55 |
0cdfd6d230e6
use std::list<std::string> instead of string_vector in pathsearch functions
John W. Eaton <jwe@octave.org>
parents:
21752
diff
changeset
|
56 std::list<std::string> all_directories (void); |
21745
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
57 |
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
58 std::string find_first (const std::string&); |
21867
0cdfd6d230e6
use std::list<std::string> instead of string_vector in pathsearch functions
John W. Eaton <jwe@octave.org>
parents:
21752
diff
changeset
|
59 |
21745
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
60 std::string find (const std::string& nm) { return find_first (nm); } |
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
61 |
21867
0cdfd6d230e6
use std::list<std::string> instead of string_vector in pathsearch functions
John W. Eaton <jwe@octave.org>
parents:
21752
diff
changeset
|
62 std::list<std::string> find_all (const std::string&); |
21745
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
63 |
21867
0cdfd6d230e6
use std::list<std::string> instead of string_vector in pathsearch functions
John W. Eaton <jwe@octave.org>
parents:
21752
diff
changeset
|
64 std::string find_first_of (const std::list<std::string>& names); |
0cdfd6d230e6
use std::list<std::string> instead of string_vector in pathsearch functions
John W. Eaton <jwe@octave.org>
parents:
21752
diff
changeset
|
65 |
0cdfd6d230e6
use std::list<std::string> instead of string_vector in pathsearch functions
John W. Eaton <jwe@octave.org>
parents:
21752
diff
changeset
|
66 std::list<std::string> |
0cdfd6d230e6
use std::list<std::string> instead of string_vector in pathsearch functions
John W. Eaton <jwe@octave.org>
parents:
21752
diff
changeset
|
67 find_all_first_of (const std::list<std::string>& names); |
21745
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
68 |
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
69 void rehash (void) |
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
70 { |
21867
0cdfd6d230e6
use std::list<std::string> instead of string_vector in pathsearch functions
John W. Eaton <jwe@octave.org>
parents:
21752
diff
changeset
|
71 m_initialized = false; |
21745
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
72 init (); |
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
73 } |
8008
4d13a7a2f6ab
dir_path: use singleton class for static data members
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
74 |
23743
e919cc8d9d92
don't use singleton pattern in pathsearch class; treat pathsep as constant
John W. Eaton <jwe@octave.org>
parents:
23615
diff
changeset
|
75 static char path_sep_char (void); |
8008
4d13a7a2f6ab
dir_path: use singleton class for static data members
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
76 |
23743
e919cc8d9d92
don't use singleton pattern in pathsearch class; treat pathsep as constant
John W. Eaton <jwe@octave.org>
parents:
23615
diff
changeset
|
77 // static void path_sep_char (char c); |
9266 | 78 |
23743
e919cc8d9d92
don't use singleton pattern in pathsearch class; treat pathsep as constant
John W. Eaton <jwe@octave.org>
parents:
23615
diff
changeset
|
79 static std::string path_sep_str (void); |
8008
4d13a7a2f6ab
dir_path: use singleton class for static data members
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
80 |
21745
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
81 static bool is_path_sep (char c) { return c == path_sep_char (); } |
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
82 |
8008
4d13a7a2f6ab
dir_path: use singleton class for static data members
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
83 private: |
4d13a7a2f6ab
dir_path: use singleton class for static data members
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
84 |
21745
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
85 // The colon separated list that we were given. |
21867
0cdfd6d230e6
use std::list<std::string> instead of string_vector in pathsearch functions
John W. Eaton <jwe@octave.org>
parents:
21752
diff
changeset
|
86 std::string m_orig_path; |
21745
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
87 |
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
88 // The default path. If specified, replaces leading, trailing, or |
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
89 // doubled colons in p_orig. |
21867
0cdfd6d230e6
use std::list<std::string> instead of string_vector in pathsearch functions
John W. Eaton <jwe@octave.org>
parents:
21752
diff
changeset
|
90 std::string m_default_path; |
5777 | 91 |
21867
0cdfd6d230e6
use std::list<std::string> instead of string_vector in pathsearch functions
John W. Eaton <jwe@octave.org>
parents:
21752
diff
changeset
|
92 // TRUE means we've unpacked the path p. |
0cdfd6d230e6
use std::list<std::string> instead of string_vector in pathsearch functions
John W. Eaton <jwe@octave.org>
parents:
21752
diff
changeset
|
93 bool m_initialized; |
21745
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
94 |
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
95 // A version of the colon separate list on which we have performed |
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
96 // tilde, variable, and possibly default path expansion. |
21867
0cdfd6d230e6
use std::list<std::string> instead of string_vector in pathsearch functions
John W. Eaton <jwe@octave.org>
parents:
21752
diff
changeset
|
97 std::string m_expanded_path; |
21745
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
98 |
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
99 // The elements of the list. |
21867
0cdfd6d230e6
use std::list<std::string> instead of string_vector in pathsearch functions
John W. Eaton <jwe@octave.org>
parents:
21752
diff
changeset
|
100 std::list<std::string> m_path_elements; |
13983
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
101 |
21745
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
102 void init (void); |
8008
4d13a7a2f6ab
dir_path: use singleton class for static data members
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
103 }; |
21745
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
104 } |
bf1121302404
use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
105 |
1786 | 106 #endif |