nds2-client - Developer 0.16.7
Loading...
Searching...
No Matches
nds_bash_pattern.hh
Go to the documentation of this file.
1/* -*- mode: C++ ; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2
3#ifndef SWIG__COMMON__NDS_BASH_PATTERN_HH
4#define SWIG__COMMON__NDS_BASH_PATTERN_HH
5
6#include <string>
7#include "bash_pattern.h"
8
9namespace NDS
10{
11 namespace detail
12 {
14 {
15 public:
16 explicit bash_pattern( const std::string& expression )
17 : compiled_expr(::bash_pattern_compile( expression.c_str( ) ) )
18 {
19 }
20
21 explicit bash_pattern( const char* expression )
23 ( expression ? expression : "" ) ) )
24 {
25 }
26
28 {
29 if ( compiled_expr )
30 {
32 }
33 }
34
35 int
36 matches( const char* text )
37 {
38 return ::bash_pattern_matches( compiled_expr, text );
39 }
40
41 private:
43
45 }; // class bash_pattern
46 }
47}
48
49#endif /* SWIG__COMMON__NDS_BASH_PATTERN_HH */
bash_pattern * bash_pattern_compile(const char *pattern)
Definition bash_pattern.c:176
void bash_pattern_free(bash_pattern *head)
Definition bash_pattern.c:235
Definition nds_bash_pattern.hh:14
int matches(const char *text)
Definition nds_bash_pattern.hh:36
::bash_pattern bash_pattern_t
Definition nds_bash_pattern.hh:42
bash_pattern(const char *expression)
Definition nds_bash_pattern.hh:21
~bash_pattern()
Definition nds_bash_pattern.hh:27
bash_pattern(const std::string &expression)
Definition nds_bash_pattern.hh:16
bash_pattern_t * compiled_expr
Definition nds_bash_pattern.hh:44
The NDS client namespace.
Definition debug_stream.cc:18
Definition bash_pattern.c:27