2 #ifndef _GLIBMM_PATTERN_H
3 #define _GLIBMM_PATTERN_H
9 * Copyright (C) 2002 The gtkmm Development Team
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details.
21 * You should have received a copy of the GNU Library General Public
22 * License along with this library; if not, write to the Free
23 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 extern "C" { typedef struct _GPatternSpec GPatternSpec; }
28 #include <glibmm/ustring.h>
34 /** @defgroup PatternMatching Glob-style Pattern Matching
35 * Match strings against patterns containing '*' (wildcard) and '?' (joker).
42 explicit PatternSpec(const Glib::ustring& pattern);
43 explicit PatternSpec(GPatternSpec* gobject);
46 bool match(const Glib::ustring& str) const;
47 bool match(const Glib::ustring& str, const Glib::ustring& str_reversed) const;
49 bool operator==(const PatternSpec& rhs) const;
50 bool operator!=(const PatternSpec& rhs) const;
52 GPatternSpec* gobj() { return gobject_; }
53 const GPatternSpec* gobj() const { return gobject_; }
56 GPatternSpec* gobject_;
59 PatternSpec(const PatternSpec&);
60 PatternSpec& operator=(const PatternSpec&);
63 /** @} group PatternMatching */
68 #endif /* _GLIBMM_PATTERN_H */