Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
grpc_core::StringMatcher Class Reference

#include <matchers.h>

Public Types

enum  Type {
  Type::kExact, Type::kPrefix, Type::kSuffix, Type::kSafeRegex,
  Type::kContains
}
 

Public Member Functions

bool case_sensitive () const
 
bool Match (absl::string_view value) const
 
StringMatcheroperator= (const StringMatcher &other)
 
StringMatcheroperator= (StringMatcher &&other) noexcept
 
bool operator== (const StringMatcher &other) const
 
RE2 * regex_matcher () const
 
const std::string & string_matcher () const
 
 StringMatcher ()=default
 
 StringMatcher (const StringMatcher &other)
 
 StringMatcher (StringMatcher &&other) noexcept
 
std::string ToString () const
 
Type type () const
 

Static Public Member Functions

static absl::StatusOr< StringMatcherCreate (Type type, absl::string_view matcher, bool case_sensitive=true)
 

Private Member Functions

 StringMatcher (std::unique_ptr< RE2 > regex_matcher)
 
 StringMatcher (Type type, absl::string_view matcher, bool case_sensitive)
 

Private Attributes

bool case_sensitive_ = true
 
std::unique_ptr< RE2 > regex_matcher_
 
std::string string_matcher_
 
Type type_ = Type::kExact
 

Detailed Description

Definition at line 32 of file matchers/matchers.h.

Member Enumeration Documentation

◆ Type

Enumerator
kExact 
kPrefix 
kSuffix 
kSafeRegex 
kContains 

Definition at line 34 of file matchers/matchers.h.

Constructor & Destructor Documentation

◆ StringMatcher() [1/5]

grpc_core::StringMatcher::StringMatcher ( )
default

◆ StringMatcher() [2/5]

grpc_core::StringMatcher::StringMatcher ( const StringMatcher other)

Definition at line 56 of file matchers/matchers.cc.

◆ StringMatcher() [3/5]

grpc_core::StringMatcher::StringMatcher ( StringMatcher &&  other)
noexcept

Definition at line 76 of file matchers/matchers.cc.

◆ StringMatcher() [4/5]

grpc_core::StringMatcher::StringMatcher ( Type  type,
absl::string_view  matcher,
bool  case_sensitive 
)
private

Definition at line 49 of file matchers/matchers.cc.

◆ StringMatcher() [5/5]

grpc_core::StringMatcher::StringMatcher ( std::unique_ptr< RE2 >  regex_matcher)
explicitprivate

Definition at line 53 of file matchers/matchers.cc.

Member Function Documentation

◆ case_sensitive()

bool grpc_core::StringMatcher::case_sensitive ( ) const
inline

Definition at line 67 of file matchers/matchers.h.

◆ Create()

absl::StatusOr< StringMatcher > grpc_core::StringMatcher::Create ( Type  type,
absl::string_view  matcher,
bool  case_sensitive = true 
)
static

Definition at line 34 of file matchers/matchers.cc.

◆ Match()

bool grpc_core::StringMatcher::Match ( absl::string_view  value) const

Definition at line 107 of file matchers/matchers.cc.

◆ operator=() [1/2]

StringMatcher & grpc_core::StringMatcher::operator= ( const StringMatcher other)

Definition at line 65 of file matchers/matchers.cc.

◆ operator=() [2/2]

StringMatcher & grpc_core::StringMatcher::operator= ( StringMatcher &&  other)
noexcept

Definition at line 85 of file matchers/matchers.cc.

◆ operator==()

bool grpc_core::StringMatcher::operator== ( const StringMatcher other) const

Definition at line 96 of file matchers/matchers.cc.

◆ regex_matcher()

RE2* grpc_core::StringMatcher::regex_matcher ( ) const
inline

Definition at line 65 of file matchers/matchers.h.

◆ string_matcher()

const std::string& grpc_core::StringMatcher::string_matcher ( ) const
inline

Definition at line 62 of file matchers/matchers.h.

◆ ToString()

std::string grpc_core::StringMatcher::ToString ( ) const

Definition at line 131 of file matchers/matchers.cc.

◆ type()

Type grpc_core::StringMatcher::type ( ) const
inline

Definition at line 59 of file matchers/matchers.h.

Member Data Documentation

◆ case_sensitive_

bool grpc_core::StringMatcher::case_sensitive_ = true
private

Definition at line 76 of file matchers/matchers.h.

◆ regex_matcher_

std::unique_ptr<RE2> grpc_core::StringMatcher::regex_matcher_
private

Definition at line 75 of file matchers/matchers.h.

◆ string_matcher_

std::string grpc_core::StringMatcher::string_matcher_
private

Definition at line 74 of file matchers/matchers.h.

◆ type_

Type grpc_core::StringMatcher::type_ = Type::kExact
private

Definition at line 73 of file matchers/matchers.h.


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


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:37