Kinetis Bootloader Host  2.0.0
Host Tools for Kinetis devices
apps/elftosb/common/GlobMatcher.h
1 /*
2  * File: GlobMatcher.h
3  *
4  * Copyright (c) Freescale Semiconductor, Inc. All rights reserved.
5  * See included license file for license details.
6  */
7 #if !defined(_GlobMatcher_h_)
8 #define _GlobMatcher_h_
9 
10 #include "StringMatcher.h"
11 
12 namespace elftosb
13 {
37 class GlobMatcher : public StringMatcher
38 {
39 public:
41  GlobMatcher(const std::string &pattern)
42  : StringMatcher()
43  , m_pattern(pattern)
44  {
45  }
46 
48  virtual bool match(const std::string &testValue);
49 
50 protected:
51  std::string m_pattern;
52 
54  bool globMatch(const char *str, const char *p);
55 };
56 
57 }; // namespace elftosb
58 
59 #endif // _GlobMatcher_h_
std::string m_pattern
The glob pattern to match against.
Definition: apps/elftosb/common/GlobMatcher.h:51
This class uses glob pattern matching to match strings.
Definition: apps/elftosb/common/GlobMatcher.h:37
GlobMatcher(const std::string &pattern)
Constructor.
Definition: apps/elftosb/common/GlobMatcher.h:41
Definition: BootImage.h:13
bool globMatch(const char *str, const char *p)
Glob implementation.
Definition: apps/elftosb/common/GlobMatcher.cpp:29
Abstract interface class used to select strings by name.
Definition: apps/elftosb/common/StringMatcher.h:17
virtual bool match(const std::string &testValue)
Returns whether testValue matches the glob pattern.
Definition: apps/elftosb/common/GlobMatcher.cpp:22