Mercurial > hg > octave-nkf
annotate liboctave/glob-match.h @ 10105:018d92ad0730
fix prototypes for zherk and cherk
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 14 Jan 2010 03:10:46 -0500 |
parents | fdc3a43c0be8 |
children | 805a83ecd3da |
rev | line source |
---|---|
2924 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1996, 1997, 2000, 2005, 2006, 2007 John W. Eaton |
2924 | 4 |
5 This file is part of Octave. | |
6 | |
7 Octave is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
2924 | 11 |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
2924 | 20 |
21 */ | |
22 | |
2926 | 23 #if !defined (octave_glob_match_h) |
24 #define octave_glob_match_h 1 | |
2924 | 25 |
26 #include <string> | |
27 | |
28 #include "Array.h" | |
29 #include "str-vec.h" | |
30 | |
31 class | |
6108 | 32 OCTAVE_API |
2924 | 33 glob_match |
34 { | |
35 public: | |
36 | |
37 enum opts | |
38 { | |
39 pathname = 1, // No wildcard can ever match `/'. | |
40 noescape = 2, // Backslashes don't quote special chars. | |
41 period = 4 // Leading `.' is matched only explicitly. | |
42 }; | |
43 | |
6095 | 44 glob_match (const std::string& p, |
2924 | 45 unsigned int f = pathname|noescape|period) |
46 : pat (p), flags (f) { } | |
47 | |
48 glob_match (const string_vector& p = string_vector (), | |
49 unsigned int f = pathname|noescape|period) | |
50 : pat (p), flags (f) { } | |
51 | |
52 glob_match (const glob_match& gm) : pat (gm.pat), flags (gm.flags) { } | |
53 | |
54 glob_match& operator = (const glob_match& gm) | |
55 { | |
56 if (this != &gm) | |
57 { | |
58 pat = gm.pat; | |
59 flags = gm.flags; | |
60 } | |
61 return *this; | |
62 } | |
63 | |
64 ~glob_match (void) { } | |
65 | |
3504 | 66 void set_pattern (const std::string& p) { pat = p; } |
2924 | 67 |
68 void set_pattern (const string_vector& p) { pat = p; } | |
69 | |
3504 | 70 bool match (const std::string&); |
2924 | 71 |
72 Array<bool> match (const string_vector&); | |
73 | |
9994
fdc3a43c0be8
avoid conflict with gnulib defining glob to be rpl_glob
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
74 // We forward to glob_internal here to avoid problems with gnulib's |
fdc3a43c0be8
avoid conflict with gnulib defining glob to be rpl_glob
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
75 // glob.h defining glob to be rpl_glob. |
fdc3a43c0be8
avoid conflict with gnulib defining glob to be rpl_glob
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
76 |
fdc3a43c0be8
avoid conflict with gnulib defining glob to be rpl_glob
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
77 string_vector glob (void) { return glob_internal (); } |
2924 | 78 |
79 private: | |
80 | |
81 // Globbing pattern(s). | |
82 string_vector pat; | |
83 | |
84 // Option flags. | |
85 unsigned int flags; | |
9994
fdc3a43c0be8
avoid conflict with gnulib defining glob to be rpl_glob
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
86 |
fdc3a43c0be8
avoid conflict with gnulib defining glob to be rpl_glob
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
87 string_vector glob_internal (void); |
2924 | 88 }; |
89 | |
90 #endif | |
91 | |
92 /* | |
93 ;;; Local Variables: *** | |
94 ;;; mode: C++ *** | |
95 ;;; End: *** | |
96 */ |