Wildcard Class Reference

`#include <wildcard.h>`

## Detailed Description

Manages a list of file wildcard entries for use in wxWidgets file dialogs.

The Wildcard class provides a convenient way to build and format wildcard filter strings compatible with wxWidgets file dialogs (e.g., `wxFileDialog`).

Each entry consists of a human-readable description and a file pattern (e.g., `*.txt`). The formatted string follows the wxWidgets wildcard format:

"Description (*.ext)|*.ext|Other (*.other)|*.other"

Example
  sdi_toolBox::desktop::wxWidgets::Wildcard wc;
  wc.addEntry("Text files", "*.txt");
  wc.addEntry("CSV files", "*.csv");
  wxString filter = wc.getWildcards(true); // includes "All files (*.*)|*.*"
  wxFileDialog dlg(this, "Open file", "", "", filter, wxFD_OPEN);
  sdi_toolBox::desktop::wxWidgets::Wildcard
  Manages a list of file wildcard entries for use in wxWidgets file dialogs.
  Definition wildcard.h:43
  sdi_toolBox::desktop::wxWidgets::Wildcard::addEntry
  void addEntry(const wxString &description, const wxString &pattern)
  Adds a new wildcard filter entry.
  Definition wildcard.h:122
  sdi_toolBox::desktop::wxWidgets::Wildcard::getWildcards
  wxString getWildcards(bool addAllFiles=false) const
  Builds and returns the formatted wildcard string for use in wxWidgets file dialogs.
  Definition wildcard.h:128

Definition at line 42 of file wildcard.h.

## Classes

struct | WildcardEntry
| Represents a single wildcard filter entry. More...

## Public Member Functions

| Wildcard ()=default
| Default constructor.
virtual | ~Wildcard ()=default
| Default destructor.
| Wildcard (const Wildcard &other)=default
| Copy constructor.
| Wildcard (Wildcard &&other) noexcept=default
| Move constructor.
Wildcard & | operator= (const Wildcard &other)=default
| Copy assignment operator.
Wildcard & | operator= (Wildcard &&other) noexcept=default
| Move assignment operator.
void | clear ()
| Removes all wildcard entries.
void | addEntry (const wxString &description, const wxString &pattern)
| Adds a new wildcard filter entry.
wxString | getWildcards (bool addAllFiles=false) const
| Builds and returns the formatted wildcard string for use in wxWidgets file dialogs.

## Protected Attributes

std::vector< WildcardEntry > | m_wildcards

## Constructor & Destructor Documentation

## Wildcard() [1/3]

Wildcard | ( |  | ) |

default

Default constructor.

## ~Wildcard()

virtual ~Wildcard | ( |  | ) |

virtualdefault

Default destructor.

## Wildcard() [2/3]

Wildcard | ( | const Wildcard & | other | ) |

default

Copy constructor.

Parameters

  other | The Wildcard instance to copy from.

## Wildcard() [3/3]

Wildcard | ( | Wildcard && | other | ) |

defaultnoexcept

Move constructor.

Parameters

  other | The Wildcard instance to move from.

## Member Function Documentation

## operator=() [1/2]

Wildcard & operator= | ( | const Wildcard & | other | ) |

default

Copy assignment operator.

Parameters

  other | The Wildcard instance to copy from.

Returns
  Reference to this instance.

## operator=() [2/2]

Wildcard & operator= | ( | Wildcard && | other | ) |

defaultnoexcept

Move assignment operator.

Parameters

  other | The Wildcard instance to move from.

Returns
  Reference to this instance.

## clear()

void clear | ( |  | ) |

inline

Removes all wildcard entries.

Definition at line 116 of file wildcard.h.

## addEntry()

void addEntry | ( | const wxString & | description,
|  | const wxString & | pattern
| ) |  |

inline

Adds a new wildcard filter entry.

Parameters

  description | Human-readable description of the file type (e.g., "Text files").
  pattern | File pattern used for filtering (e.g., "*.txt").

Definition at line 122 of file wildcard.h.

## getWildcards()

wxString getWildcards | ( | bool | addAllFiles = `false` | ) | const

inline

Builds and returns the formatted wildcard string for use in wxWidgets file dialogs.

Parameters

  addAllFiles | If `true`, appends an "All files (*.*)|*.*" entry at the end.

Returns
  A formatted wildcard string compatible with wxWidgets file dialog filters.

Definition at line 128 of file wildcard.h.

## Member Data Documentation

## m_wildcards

std::vector<WildcardEntry> m_wildcards

protected

Definition at line 112 of file wildcard.h.