libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
gbl::Pattern Class Reference

#include <gimbal_pattern.hpp>

Public Member Functions

 Pattern (const char *pRegExp) noexcept
 
 Pattern (const GblPattern *pPattern) noexcept
 
 Pattern (const Pattern &rhs) noexcept
 
 Pattern (Pattern &&rhs) noexcept
 
bool isValid () const noexcept
 
std::size_t refCount () const noexcept
 
std::size_t bytes () const noexcept
 
std::string string () const noexcept
 
 operator const GblPattern * () const noexcept
 
Patternoperator= (const char *pPattern) noexcept
 
Patternoperator= (const GblPattern *pPattern) noexcept
 
Patternoperator= (const Pattern &rhs) noexcept
 
Patternoperator= (Pattern &&rhs) noexcept
 
bool match (const char *pString, GblStringView *pView=nullptr, int *pCount=nullptr) const noexcept
 
bool matchNot (const char *pString, GblStringView *pView=nullptr, int *pCount=nullptr) const noexcept
 
bool matchExact (const char *pString) const noexcept
 
bool matchCount (const char *pString) const noexcept
 

Friends

std::ostream & operator<< (std::ostream &os, const Pattern &pat)
 

Detailed Description

OO C++ binding object around GblPattern.

gbl::Pattern represents a compiled regular expression string, providing an API around the pattern matching/regex engine.

See also
GblPattern

Definition at line 31 of file gimbal_pattern.hpp.

Constructor & Destructor Documentation

◆ Pattern() [1/4]

gbl::Pattern::Pattern ( const char *  pRegExp)
inlinenoexcept

Definition at line 36 of file gimbal_pattern.hpp.

36 :
37 pPattern_(GblPattern_create(pRegExp)) {}

◆ Pattern() [2/4]

gbl::Pattern::Pattern ( const GblPattern pPattern)
inlinenoexcept

Definition at line 39 of file gimbal_pattern.hpp.

39 :
40 pPattern_(pPattern) {}

◆ Pattern() [3/4]

gbl::Pattern::Pattern ( const Pattern rhs)
inlinenoexcept

Definition at line 42 of file gimbal_pattern.hpp.

42 :
43 pPattern_(GblPattern_ref(rhs.pPattern_)) {}

◆ Pattern() [4/4]

gbl::Pattern::Pattern ( Pattern &&  rhs)
inlinenoexcept

Definition at line 45 of file gimbal_pattern.hpp.

45 :
46 pPattern_(rhs.pPattern_)
47 {
48 rhs.pPattern_ = nullptr;
49 }

◆ ~Pattern()

gbl::Pattern::~Pattern ( )
inlinenoexcept

Definition at line 51 of file gimbal_pattern.hpp.

51 {
52 GblPattern_unref(pPattern_);
53 }

Member Function Documentation

◆ isValid()

bool gbl::Pattern::isValid ( ) const
inlinenoexcept

Definition at line 55 of file gimbal_pattern.hpp.

55{ return pPattern_; }

◆ refCount()

std::size_t gbl::Pattern::refCount ( ) const
inlinenoexcept

Definition at line 57 of file gimbal_pattern.hpp.

57{ return GblPattern_refCount(pPattern_); }

◆ bytes()

std::size_t gbl::Pattern::bytes ( ) const
inlinenoexcept

Definition at line 59 of file gimbal_pattern.hpp.

59{ return GblPattern_bytes(pPattern_); }

◆ operator const GblPattern *()

gbl::Pattern::operator const GblPattern * ( ) const
inlinenoexcept

Definition at line 63 of file gimbal_pattern.hpp.

63{ return pPattern_; }

◆ operator=() [1/4]

Pattern & gbl::Pattern::operator= ( const char *  pPattern)
inlinenoexcept

Definition at line 65 of file gimbal_pattern.hpp.

65 {
66 GblPattern_unref(pPattern_);
67 pPattern_ = GblPattern_create(pPattern);
68 return *this;
69 }

◆ operator=() [2/4]

Pattern & gbl::Pattern::operator= ( const GblPattern pPattern)
inlinenoexcept

Definition at line 71 of file gimbal_pattern.hpp.

71 {
72 GblPattern_unref(pPattern_);
73 pPattern_ = pPattern;
74 return *this;
75 }

◆ operator=() [3/4]

Pattern & gbl::Pattern::operator= ( const Pattern rhs)
inlinenoexcept

Definition at line 77 of file gimbal_pattern.hpp.

77 {
78 GblPattern_unref(pPattern_);
79 pPattern_ = GblPattern_ref(rhs.pPattern_);
80 return *this;
81 }

◆ operator=() [4/4]

Pattern & gbl::Pattern::operator= ( Pattern &&  rhs)
inlinenoexcept

Definition at line 83 of file gimbal_pattern.hpp.

83 {
84 GblPattern_unref(pPattern_);
85 pPattern_ = rhs.pPattern_;
86 rhs.pPattern_ = nullptr;
87 return *this;
88 }

◆ match()

bool gbl::Pattern::match ( const char *  pString,
GblStringView pView = nullptr,
int *  pCount = nullptr 
) const
inlinenoexcept

Definition at line 90 of file gimbal_pattern.hpp.

93 {
94 return GblPattern_match(*this, pString, pView, pCount);
95 }

◆ matchNot()

bool gbl::Pattern::matchNot ( const char *  pString,
GblStringView pView = nullptr,
int pCount = nullptr 
) const
inlinenoexcept

Definition at line 97 of file gimbal_pattern.hpp.

100 {
101 return GblPattern_matchNot(*this, pString, pView, pCount);
102 }

◆ matchExact()

bool gbl::Pattern::matchExact ( const char pString) const
inlinenoexcept

Definition at line 104 of file gimbal_pattern.hpp.

104 {
105 return GblPattern_matchExact(*this, pString);
106 }

◆ matchCount()

bool gbl::Pattern::matchCount ( const char pString) const
inlinenoexcept

Definition at line 108 of file gimbal_pattern.hpp.

108 {
109 return GblPattern_matchCount(*this, pString);
110 }

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const Pattern pat 
)
friend

Definition at line 112 of file gimbal_pattern.hpp.

112 {
113 os << pat.string();
114 return os;
115 }

The documentation for this class was generated from the following file: