Defines the base parser interface (ICardDatabaseParser) for all card database parsers.
More...
#include <card_database_parser.h>
|
| | ~ICardDatabaseParser () override=default |
| virtual bool | getCanParseFile (const QString &name, QIODevice &device)=0 |
| | Checks whether this parser can parse the given file.
|
| virtual void | parseFile (QIODevice &device)=0 |
| | Parses a database file and emits addCard/addSet signals.
|
| virtual bool | saveToFile (SetNameMap sets, CardNameMap cards, const QString &fileName, const QString &sourceUrl="unknown", const QString &sourceVersion="unknown")=0 |
| | Saves card and set data to a file.
|
|
| static void | clearSetlist () |
| | Clears the cached global set list.
|
|
| static SetNameMap | sets |
| | Cached global list of sets shared between all parsers.
|
Defines the base parser interface (ICardDatabaseParser) for all card database parsers.
Provides methods for checking file compatibility, parsing, and saving card databases. Also provides shared access to the global set list for cross-referencing.
◆ ~ICardDatabaseParser()
| ICardDatabaseParser::~ICardDatabaseParser |
( |
| ) |
|
|
overridedefault |
◆ addCard
Emitted when a card is loaded from the database.
◆ addSet
| void ICardDatabaseParser::addSet |
( |
CardSetPtr | set | ) |
|
|
signal |
Emitted when a set is loaded from the database.
◆ clearSetlist()
| void ICardDatabaseParser::clearSetlist |
( |
| ) |
|
|
static |
Clears the cached global set list.
◆ getCanParseFile()
| virtual bool ICardDatabaseParser::getCanParseFile |
( |
const QString & | name, |
|
|
QIODevice & | device ) |
|
pure virtual |
Checks whether this parser can parse the given file.
- Parameters
-
| name | File name (used for extension checks). |
| device | QIODevice representing the file content. |
- Returns
- true if the parser can handle this file.
Implemented in CockatriceXml3Parser, and CockatriceXml4Parser.
◆ internalAddSet()
Internal helper to add a set to the global set cache.
- Parameters
-
| setName | Short set name. |
| longName | Optional full name. |
| setType | Optional set type string. |
| releaseDate | Optional release date. |
| priority | Optional priority (fallback if not specified). |
- Returns
- Pointer to the added or existing CardSet instance.
◆ parseFile()
| virtual void ICardDatabaseParser::parseFile |
( |
QIODevice & | device | ) |
|
|
pure virtual |
◆ saveToFile()
| virtual bool ICardDatabaseParser::saveToFile |
( |
SetNameMap | sets, |
|
|
CardNameMap | cards, |
|
|
const QString & | fileName, |
|
|
const QString & | sourceUrl = "unknown", |
|
|
const QString & | sourceVersion = "unknown" ) |
|
pure virtual |
Saves card and set data to a file.
- Parameters
-
| sets | Map of sets to save. |
| cards | Map of cards to save. |
| fileName | Target file path. |
| sourceUrl | Optional source URL of the database. |
| sourceVersion | Optional version string of the source. |
- Returns
- true if save succeeded.
Implemented in CockatriceXml3Parser, and CockatriceXml4Parser.
◆ sets
Cached global list of sets shared between all parsers.
The documentation for this class was generated from the following files: