Lightweight 0.20251202.0
Loading...
Searching...
No Matches
Lightweight::SqlBackup::TableFilter Class Reference

#include <TableFilter.hpp>

Public Member Functions

bool Matches (std::string_view schema, std::string_view tableName) const
 
bool MatchesAll () const noexcept
 Returns true if the filter matches all tables (no filtering applied).
 
size_t PatternCount () const noexcept
 Returns the number of patterns in this filter.
 

Static Public Member Functions

static TableFilter Parse (std::string_view filterSpec)
 

Detailed Description

Filters tables by name patterns with glob-style wildcards.

Supports:

  • Exact table names: "Users", "Products"
  • Wildcard suffix: "User*" (matches UserAccounts, Users, etc.)
  • Wildcard prefix: "*_log" (matches audit_log, error_log, etc.)
  • Wildcard anywhere: "*audit*" (matches any table containing "audit")
  • Single char wildcard: "User?" (matches Users, User1, etc.)
  • Schema.table notation: "dbo.Users", "sales.*"
  • Comma-separated patterns: "Users,Products,*_log"

Definition at line 29 of file TableFilter.hpp.

Member Function Documentation

◆ Parse()

static TableFilter Lightweight::SqlBackup::TableFilter::Parse ( std::string_view  filterSpec)
static

Parses a filter specification string.

Parameters
filterSpecComma-separated patterns like "table1,table2,foo*,schema.table" Empty string or "*" means match all tables.

◆ Matches()

bool Lightweight::SqlBackup::TableFilter::Matches ( std::string_view  schema,
std::string_view  tableName 
) const

Checks if a table matches any of the patterns.

Parameters
schemaThe schema name (can be empty).
tableNameThe table name.
Returns
true if the table matches at least one pattern.

◆ MatchesAll()

bool Lightweight::SqlBackup::TableFilter::MatchesAll ( ) const
inlinenoexcept

Returns true if the filter matches all tables (no filtering applied).

Definition at line 46 of file TableFilter.hpp.

◆ PatternCount()

size_t Lightweight::SqlBackup::TableFilter::PatternCount ( ) const
inlinenoexcept

Returns the number of patterns in this filter.

Definition at line 49 of file TableFilter.hpp.


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