mitiru::data

Namespace catalog extracted from docs/API_CATALOG.md (30 types, 199 items).

Namespace catalog extracted from docs/API_CATALOG.md (30 types, 199 items).

NameKindItems
BinaryTagenum11
BinVec2struct2
BinVec3struct3
BinColorstruct4
BinaryWriterclass15
BinaryReaderclass22
ConfigManagerclass12
ContentLoaderclass8
CsvParserclass8
IniParserclass18
FromJsonResultstruct4
MigrationChainclass4
JsonBuilderclass13
JsonReaderclass1
Migrationclass8
Prefabstruct3
PrefabLibraryclass7
ProjectConfigstruct2
ProjectFileclass2
SaveSchemaclass13
SchemaImportResultstruct5
SchemaImporterclass5
FieldTypeenum6
SchemaFieldstruct5
Schemastruct3
ValidationResultstruct1
SchemaValidatorclass5
TilemapLayerstruct2
Tilemapstruct2
TilemapLoaderclass5
enum BinaryTag : uint8_t 11
Int32 = 0x01
Float32 = 0x02
String = 0x03
Bool = 0x04
Vec2 = 0x05
Vec3 = 0x06
Color = 0x07
Array = 0x08
Bytes = 0x09
Int64 = 0x0A
Float64 = 0x0B
struct BinVec2 2
float x = 0.0f
float y = 0.0f
struct BinVec3 3
float x = 0.0f
float y = 0.0f
float z = 0.0f
struct BinColor 4
float r = 0.0f
float g = 0.0f
float b = 0.0f
float a = 1.0f
class BinaryWriter 15
BinaryWriter()
BinaryWriter& writeInt(int32_t value)
BinaryWriter& writeInt64(int64_t value)
BinaryWriter& writeFloat(float value)
BinaryWriter& writeDouble(double value)
BinaryWriter& writeString(const std::string& value)
BinaryWriter& writeBool(bool value)
BinaryWriter& writeVec2(float x, float y)
BinaryWriter& writeVec3(float x, float y, float z)
BinaryWriter& writeColor(float r, float g, float b, float a)
BinaryWriter& writeArray(const std::vector<int32_t>& values)
BinaryWriter& writeArray(const std::vector<float>& values)
BinaryWriter& writeArray(const std::vector<std::string>& values)
BinaryWriter& writeBytes(const uint8_t* data, std::size_t size)
[[nodiscard]] std::vector<uint8_t> finish()
class BinaryReader 22
BinaryReader(const uint8_t* data, std::size_t size)
explicit BinaryReader(const std::vector<uint8_t>& data)
[[nodiscard]] bool isValid() const noexcept
[[nodiscard]] std::size_t remaining() const noexcept
[[nodiscard]] bool atEnd() const noexcept
[[nodiscard]] int32_t readInt()
[[nodiscard]] int64_t readInt64()
[[nodiscard]] float readFloat()
[[nodiscard]] double readDouble()
[[nodiscard]] std::string readString()
[[nodiscard]] bool readBool()
[[nodiscard]] BinVec2 readVec2()
[[nodiscard]] BinVec3 readVec3()
[[nodiscard]] BinColor readColor()
[[nodiscard]] std::vector<int32_t> readIntArray()
[[nodiscard]] std::vector<float> readFloatArray()
[[nodiscard]] std::vector<std::string> readStringArray()
[[nodiscard]] std::vector<uint8_t> readBytes()
[[nodiscard]] BinaryTag peekTag() const
using ConfigValue = std::variant<std::string, int, float, bool>;
using ConfigChangeCallback = std::function<void(const ConfigValue&)>;
[[nodiscard]] static size_t skipWs(const std::string& s, size_t pos)
class ConfigManager 12
void set(const std::string& key, const ConfigValue& value)
template <typename T> [[nodiscard]] std::optional<T> get(const std::string& key) const
[[nodiscard]] std::optional<std::string> getString(const std::string& key) const
[[nodiscard]] std::optional<int> getInt(const std::string& key) const
[[nodiscard]] std::optional<float> getFloat(const std::string& key) const
[[nodiscard]] std::optional<bool> getBool(const std::string& key) const
bool loadFromJson(const std::string& json)
[[nodiscard]] std::string saveToJson() const
[[nodiscard]] bool hasKey(const std::string& key) const
[[nodiscard]] std::vector<std::string> keys() const
void setDefault(const std::string& key, const ConfigValue& value)
void onChange(const std::string& key, ConfigChangeCallback callback)
class ContentLoader 8
ContentLoader() = default
~ContentLoader() = default
[[nodiscard]] static FromJsonResult<T> loadFile(const std::string& path)
[[nodiscard]] static FromJsonResult<T> loadJson(const Json& json)
[[nodiscard]] static FromJsonResult<T> loadString(const std::string& s)
[[nodiscard]] static FromJsonResult<T> loadFileValidated( const std::string& path, const Schema& schema)
[[nodiscard]] static FromJsonResult<T> loadJsonValidated( const Json& json, const Schema& schema)
[[nodiscard]] static FromJsonResult<T> loadStringValidated( const std::string& s, const Schema& schema)
class CsvParser 8
void parse(const std::string& text)
[[nodiscard]] int rowCount() const noexcept
[[nodiscard]] int columnCount(int row) const noexcept
[[nodiscard]] std::string get(int row, int col) const
[[nodiscard]] int getInt(int row, int col, int defaultVal = 0) const
[[nodiscard]] float getFloat(int row, int col, float defaultVal = 0) const
[[nodiscard]] std::vector<std::string> getRow(int row) const
void clear()
class IniParser 18
void parse(const std::string& text)
[[nodiscard]] std::string get(const std::string& section, const std::string& key, const std::string& defaultVal = {}) const
[[nodiscard]] int getInt(const std::string& section, const std::string& key, int defaultVal = 0) const
[[nodiscard]] float getFloat(const std::string& section, const std::string& key, float defaultVal = 0) const
[[nodiscard]] bool getBool(const std::string& section, const std::string& key, bool defaultVal = false) const
[[nodiscard]] bool hasSection(const std::string& section) const
[[nodiscard]] bool hasKey(const std::string& section, const std::string& key) const
[[nodiscard]] std::vector<std::string> sections() const
void clear()
using Json = nlohmann::json;
[[nodiscard]] inline std::optional<Json> loadJsonFile(const std::string& path)
inline bool saveJsonFile(const std::string& path, const Json& j, int indent = 2)
[[nodiscard]] inline std::optional<Json> parseJson(const std::string& str)
template <typename T> [[nodiscard]] inline Json toJson(const T& value)
template <typename T> [[nodiscard]] inline std::optional<T> fromJson(const Json& json) noexcept
template <typename T> [[nodiscard]] inline FromJsonResult<T> fromJsonResult(const Json& json)
template <typename T> [[nodiscard]] inline Json toJsonVersioned(const T& value, int version)
template <typename T> [[nodiscard]] inline FromJsonResult<T> fromJsonVersioned(const Json& json, int expectedVersion)
struct FromJsonResult 4
std::optional<T> value
std::string error
[[nodiscard]] bool ok() const noexcept
[[nodiscard]] explicit operator bool() const noexcept
class MigrationChain 4
using Migrate = std::function<Json(Json)>;
MigrationChain& addStep(int fromVersion, int toVersion, Migrate migrate)
[[nodiscard]] FromJsonResult<T> load(const Json& json, int currentVersion) const
[[nodiscard]] std::size_t stepCount() const noexcept
class JsonBuilder 13
JsonBuilder& beginObject()
JsonBuilder& beginArray()
JsonBuilder& endArray()
JsonBuilder& key(const std::string& k)
JsonBuilder& value(const std::string& v)
JsonBuilder& value(const char* v)
JsonBuilder& value(int v)
JsonBuilder& value(float v)
JsonBuilder& value(double v)
JsonBuilder& value(bool v)
JsonBuilder& array(const std::string& k, const std::vector<float>& values)
JsonBuilder& rawValue(const std::string& raw)
[[nodiscard]] std::string build() const
class JsonReader 1
bool parse(const std::string& json)
class Migration 8
using Op = std::function<Json(Json)>;
[[nodiscard]] static inline Op backfillField(std::string field, Json defaultValue)
[[nodiscard]] static inline Op renameField(std::string oldName, std::string newName)
[[nodiscard]] static inline Op removeField(std::string field)
[[nodiscard]] static inline Op setField(std::string field, Json value)
[[nodiscard]] static inline Op transformField(std::string field, std::function<Json(Json)> fn)
[[nodiscard]] static inline Op compose(std::initializer_list<Op> ops)
[[nodiscard]] static inline Op compose(std::vector<Op> ops)
struct Prefab 3
std::string name
std::string componentsJson
std::vector<std::string> childPrefabs
class PrefabLibrary 7
void registerPrefab(const Prefab& prefab)
[[nodiscard]] scene::EntityId instantiate( const std::string& prefabName, scene::GameWorld& world) const
[[nodiscard]] scene::EntityId instantiateWithOverrides( const std::string& prefabName, const std::string& overridesJson, scene::GameWorld& world) const
[[nodiscard]] std::optional<Prefab> getPrefab(const std::string& name) const
[[nodiscard]] std::vector<std::string> allPrefabNames() const
bool loadFromJson(const std::string& json)
[[nodiscard]] std::string toJson() const
struct ProjectConfig 2
std::string projectName
std::vector<std::string> assetPaths
class ProjectFile 2
[[nodiscard]] static std::string saveToString(const ProjectConfig& config)
[[nodiscard]] static std::optional<ProjectConfig> loadFromString(const std::string& json)
class SaveSchema 13
explicit SaveSchema(int currentVersion) noexcept
SaveSchema(const SaveSchema&) = default
SaveSchema& operator=(const SaveSchema&) = default
SaveSchema(SaveSchema&&) = default
SaveSchema& operator=(SaveSchema&&) = default
~SaveSchema() = default
[[nodiscard]] int currentVersion() const noexcept
[[nodiscard]] MigrationChain<T>& migrations() noexcept
[[nodiscard]] const MigrationChain<T>& migrations() const noexcept
[[nodiscard]] Json toJson(const T& value) const
[[nodiscard]] std::string toJsonString(const T& value) const
[[nodiscard]] FromJsonResult<T> fromJson(const Json& json) const
[[nodiscard]] FromJsonResult<T> fromJsonString(const std::string& s) const
struct SchemaImportResult 5
std::optional<Schema> schema
std::string error
std::vector<std::string> warnings
[[nodiscard]] bool ok() const noexcept
explicit operator bool() const noexcept
class SchemaImporter 5
SchemaImporter() = default
~SchemaImporter() = default
[[nodiscard]] static SchemaImportResult fromJsonSchemaString( const std::string& s, std::string schemaName)
[[nodiscard]] static SchemaImportResult fromJsonSchemaJson( const Json& json, std::string schemaName)
[[nodiscard]] static SchemaImportResult fromJsonSchemaFile( const std::string& path, std::string schemaName)
enum FieldType 6
String
Int
Float
Bool
Array
Object
struct SchemaField 5
std::string name
std::string defaultValue
std::string description
std::optional<float> minValue
std::optional<float> maxValue
struct Schema 3
std::string name
std::string version
std::vector<SchemaField> fields
struct ValidationResult 1
std::vector<std::string> errors
class SchemaValidator 5
SchemaValidator()
void registerSchema(const Schema& schema)
[[nodiscard]] ValidationResult validate( const std::string& schemaName, const std::string& jsonString) const
[[nodiscard]] std::string generateTemplate(const std::string& schemaName) const
[[nodiscard]] std::optional<Schema> getSchema(const std::string& name) const
struct TilemapLayer 2
std::string name
std::vector<TileData> tiles
struct Tilemap 2
std::string name
std::vector<TilemapLayer> layers
class TilemapLoader 5
[[nodiscard]] std::optional<Tilemap> loadFromJson(const std::string& json) const
[[nodiscard]] std::string saveToJson(const Tilemap& tilemap) const
[[nodiscard]] std::optional<TileData> getTile( const TilemapLayer& layer, int x, int y) const
void setTile(TilemapLayer& layer, int x, int y, const TileData& tileData)
[[nodiscard]] Tilemap createEmpty( const std::string& name, int width, int height, int tileW, int tileH) const

Sourced from docs/API_CATALOG.md, auto-generated by tools/generate_api_catalog.py.