clang-tools 19.0.0git
Classes | Public Member Functions | List of all members
clang::tidy::GlobList Class Reference

Read-only set of strings represented as a list of positive and negative globs. More...

#include <GlobList.h>

Inheritance diagram for clang::tidy::GlobList:
Inheritance graph
[legend]

Public Member Functions

virtual ~GlobList ()=default
 
 GlobList (StringRef Globs, bool KeepNegativeGlobs=true)
 Globs is a comma-separated list of globs (only the '*' metacharacter is supported) with an optional '-' prefix to denote exclusion.
 
virtual bool contains (StringRef S) const
 Returns true if the pattern matches S.
 

Detailed Description

Read-only set of strings represented as a list of positive and negative globs.

Positive globs add all matched strings to the set, negative globs remove them in the order of appearance in the list.

Definition at line 25 of file GlobList.h.

Constructor & Destructor Documentation

◆ ~GlobList()

virtual clang::tidy::GlobList::~GlobList ( )
virtualdefault

◆ GlobList()

clang::tidy::GlobList::GlobList ( StringRef  Globs,
bool  KeepNegativeGlobs = true 
)

Globs is a comma-separated list of globs (only the '*' metacharacter is supported) with an optional '-' prefix to denote exclusion.

An empty Globs string is interpreted as one glob that matches an empty string.

KeepNegativeGlobs a bool flag indicating whether to keep negative globs from Globs or not. When false, negative globs are simply ignored.

Definition at line 41 of file GlobList.cpp.

References clang::tidy::consumeGlob(), and clang::tidy::consumeNegativeIndicator().

Member Function Documentation

◆ contains()

bool clang::tidy::GlobList::contains ( StringRef  S) const
virtual

Returns true if the pattern matches S.

The result is the last matching glob's Positive flag.

Reimplemented in clang::tidy::CachedGlobList.

Definition at line 52 of file GlobList.cpp.

Referenced by clang::tidy::portability::RestrictSystemIncludesCheck::contains(), and clang::tidy::CachedGlobList::contains().


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