Cockatrice
2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Toggle main menu visibility
Loading...
Searching...
No Matches
deck_filter_string.h
Go to the documentation of this file.
1
6
7
#ifndef DECK_FILTER_STRING_H
8
#define DECK_FILTER_STRING_H
9
10
#include <QLoggingCategory>
11
#include <QString>
12
#include <functional>
13
#include <
libcockatrice/card/card_localization.h
>
14
15
struct
CardSearchLanguage
;
16
struct
LoadedDeck
;
17
18
inline
Q_LOGGING_CATEGORY
(DeckFilterStringLog,
"deck_filter_string"
);
19
26
struct
DeckSearchData
27
{
28
const
LoadedDeck
*
deck
=
nullptr
;
29
QString
filePath
;
30
QString
displayName
;
31
QString
relativeFilePath
;
32
};
33
34
typedef
std::function<bool(
const
DeckSearchData
&data)>
DeckFilter
;
35
36
class
DeckFilterString
37
{
38
public
:
39
DeckFilterString
();
40
explicit
DeckFilterString
(
const
QString &expr,
const
CardSearchLanguage
&searchLanguage = {});
41
bool
check
(
const
DeckSearchData
&data)
const
42
{
43
return
filter
(data);
44
}
45
46
[[nodiscard]]
bool
valid
()
const
47
{
48
return
_error
.isEmpty();
49
}
50
51
QString
error
()
52
{
53
return
_error
;
54
}
55
56
private
:
57
QString
_error
;
58
DeckFilter
filter
;
59
};
60
#endif
// DECK_FILTER_STRING_H
DeckFilterString::_error
QString _error
Definition
deck_filter_string.h:57
DeckFilterString::filter
DeckFilter filter
Definition
deck_filter_string.h:58
DeckFilterString::check
bool check(const DeckSearchData &data) const
Definition
deck_filter_string.h:41
DeckFilterString::DeckFilterString
DeckFilterString()
Definition
deck_filter_string.cpp:173
DeckFilterString::valid
bool valid() const
Definition
deck_filter_string.h:46
DeckFilterString::error
QString error()
Definition
deck_filter_string.h:51
Q_LOGGING_CATEGORY
Q_LOGGING_CATEGORY(CrashReportLog, "crash_report")
DeckFilter
std::function< bool(const DeckSearchData &data)> DeckFilter
Definition
deck_filter_string.h:34
card_localization.h
CardSearchLanguage
The card language and matching mode searches run against.
Definition
card_localization.h:27
DeckSearchData
Definition
deck_filter_string.h:27
DeckSearchData::deck
const LoadedDeck * deck
The loaded deck. Must not be null.
Definition
deck_filter_string.h:28
DeckSearchData::filePath
QString filePath
Absolute path of the deck file.
Definition
deck_filter_string.h:29
DeckSearchData::relativeFilePath
QString relativeFilePath
File path relative to the deck folder.
Definition
deck_filter_string.h:31
DeckSearchData::displayName
QString displayName
Deck name, or the file name if the deck has no name.
Definition
deck_filter_string.h:30
LoadedDeck
Represents a deck that was loaded from somewhere. Contains the DeckList itself, as well as info about...
Definition
loaded_deck.h:14
cockatrice
src
filters
deck_filter_string.h
Generated by
1.18.0