CPUnit 0.95 (beta)
The REAL C++ port of JUnit.
cpunit::GlobMatcher Class Reference

#include <cpunit_GlobMatcher.hpp>

List of all members.

Public Member Functions

 GlobMatcher (const std::string _pattern)
virtual ~GlobMatcher ()
bool matches (const std::string &s) const

Private Member Functions

bool attempt_match (const std::string &s, const std::size_t si, const std::size_t pi) const
 Attempt to match the substring 's.substr(si)' with the pattern 'pattern.substring(pi)'.
bool on_wildcard (const std::string &s, const std::size_t si, const std::size_t wci) const
 s - the string under concideration si - the index in the string to consider next wci - the wildcard index in the pattern

Static Private Member Functions

static std::string contract_wildcards (const std::string &s)
 Contracts consecutive sequences of wildcards to one wildcard.

Private Attributes

const std::string pattern

Static Private Attributes

static const char wc

Detailed Description

Definition at line 40 of file cpunit_GlobMatcher.hpp.


Constructor & Destructor Documentation

cpunit::GlobMatcher::GlobMatcher ( const std::string  _pattern)

Definition at line 46 of file cpunit_GlobMatcher.cpp.

cpunit::GlobMatcher::~GlobMatcher ( ) [virtual]

Definition at line 52 of file cpunit_GlobMatcher.cpp.


Member Function Documentation

bool cpunit::GlobMatcher::attempt_match ( const std::string &  s,
const std::size_t  si,
const std::size_t  pi 
) const [private]

Attempt to match the substring 's.substr(si)' with the pattern 'pattern.substring(pi)'.

Definition at line 76 of file cpunit_GlobMatcher.cpp.

std::string cpunit::GlobMatcher::contract_wildcards ( const std::string &  s) [static, private]

Contracts consecutive sequences of wildcards to one wildcard.

Definition at line 56 of file cpunit_GlobMatcher.cpp.

bool cpunit::GlobMatcher::matches ( const std::string &  s) const

Definition at line 70 of file cpunit_GlobMatcher.cpp.

bool cpunit::GlobMatcher::on_wildcard ( const std::string &  s,
const std::size_t  si,
const std::size_t  wci 
) const [private]

s - the string under concideration si - the index in the string to consider next wci - the wildcard index in the pattern

Definition at line 94 of file cpunit_GlobMatcher.cpp.


Member Data Documentation

const std::string cpunit::GlobMatcher::pattern [private]

Definition at line 42 of file cpunit_GlobMatcher.hpp.

const char cpunit::GlobMatcher::wc [static, private]

Definition at line 41 of file cpunit_GlobMatcher.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines