GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
glob-match.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1996-2017 John W. Eaton
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
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
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
18 along with Octave; see the file COPYING. If not, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if defined (HAVE_CONFIG_H)
24 # include "config.h"
25 #endif
26 
27 #include "glob-match.h"
28 #include "oct-glob.h"
29 #include "glob-wrappers.h"
30 
31 bool
33 {
34  return octave::sys::fnmatch (pat, str, fnmatch_flags);
35 }
36 
38 glob_match::glob (void) const
39 {
40  return octave::sys::glob (pat);
41 }
42 
43 int
44 glob_match::opts_to_fnmatch_flags (unsigned int xopts) const
45 {
46  int retval = 0;
47 
48  if (xopts & pathname)
49  retval |= octave_fnm_pathname_wrapper ();
50 
51  if (xopts & noescape)
52  retval |= octave_fnm_noescape_wrapper ();
53 
54  if (xopts & period)
55  retval |= octave_fnm_period_wrapper ();
56 
57  return retval;
58 }
bool fnmatch(const string_vector &pat, const std::string &str, int fnm_flags)
Definition: oct-glob.cc:55
int octave_fnm_period_wrapper(void)
int opts_to_fnmatch_flags(unsigned int xopts) const
Definition: glob-match.cc:44
std::string str
Definition: hash.cc:118
octave_value retval
Definition: data.cc:6294
bool match(const std::string &str) const
Definition: glob-match.cc:32
int fnmatch_flags
Definition: glob-match.h:98
int octave_fnm_pathname_wrapper(void)
Definition: glob-wrappers.c:95
int octave_fnm_noescape_wrapper(void)
string_vector pat
Definition: glob-match.h:95
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:854
string_vector glob(const string_vector &pat)
Definition: oct-glob.cc:70
string_vector glob(void) const
Definition: glob-match.cc:38