Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
GameData Class Reference

The JSON asset loader – the raw data source behind every database. More...

#include <gamedata.h>

Inheritance diagram for GameData:
Collaboration diagram for GameData:

Public Member Functions

const QByteArray jsonRaw (const QString filename) const
 Raw bytes of filename (no .json extension).
const QJsonDocument json (const QString filename) const
 Parsed document for filename.
const QString jsonStr (const QString filename) const
 filename as a string (for QML).
void qmlProtect (const QQmlEngine *const engine) const
 Pin to C++ ownership.

Static Public Member Functions

static GameDatainst ()
 The process-wide GameData singleton.

Detailed Description

The JSON asset loader – the raw data source behind every database.

A singleton that reads the bundled /assets/data/.json files from disk. Each DB's load() calls into this to get its document. Exposed to QML as db.json.

See also
DB (the aggregate), and every *DB::load().

Definition at line 35 of file gamedata.h.

Member Function Documentation

◆ inst()

◆ json()

◆ jsonRaw()

const QByteArray GameData::jsonRaw ( const QString filename) const

Raw bytes of filename (no .json extension).

Definition at line 29 of file gamedata.cpp.

Referenced by json(), and jsonStr().

◆ jsonStr()

const QString GameData::jsonStr ( const QString filename) const

filename as a string (for QML).

Definition at line 51 of file gamedata.cpp.

References jsonRaw().

◆ qmlProtect()

void GameData::qmlProtect ( const QQmlEngine *const engine) const

Pin to C++ ownership.

Definition at line 56 of file gamedata.cpp.

References Utility::qmlProtectUtil().

Referenced by DB::qmlProtect().


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