SaveFileConfig

class rlogic::SaveFileConfig

Holds configuration settings for saving rlogic::LogicEngine instances into a file. This config file is designed to work with the Ramses Composer editor, but you can use the metadata to store version and export information from any exporter (or script). Use the config to trace the origin and export environment of assets during runtime.

Public Functions

void setMetadataString(std::string_view metadata)

Adds custom string metadata to the binary file saved by rlogic::LogicEngine. Can be any string. It is not used by anything other than logging info, particularly when loading a file and when errors occur.

Parameters
  • metadata: the string to be written together with the saved binary data

void setExporterVersion(uint32_t major, uint32_t minor, uint32_t patch, uint32_t fileFormatVersion)

Specifies the semantic version of the exporter (binary, or script, or runtime logic). Use this to match a given asset later (e.g. when used in runtime) to the originating export tool to verify compatibility or diagnose errors and issues easier.

Parameters
  • major: the major version number

  • minor: the minor version number

  • patch: the patch version number

  • fileFormatVersion: the file format used by the exporter itself (use 0 if not applicable)

void setValidationEnabled(bool validationEnabled)

By default, saving to file validates the content and issues warnings (see rlogic::LogicEngine::validate). This behavior can be disabled here. Calling this with validationEnabled=false will itself cause a INFO log, but will silence further warnings in the content.

Parameters
  • validationEnabled: flag to disable/enable validation upon saving to file

void setLuaSavingMode(ELuaSavingMode mode)

Sets saving mode for all rlogic::LuaScript and/or rlogic::LuaModule instances. See rlogic::ELuaSavingMode for the available options and their implications. Note that this is just a hint and the export logic will decide what to actually export, depending on availabilty of Lua source code or bytecode:

  • if only source code is available (always the case when using rlogic::EFeatureLevel_01) then only source code is exported regardless of the selected saving mode

  • if only byte code is available then only bytecode is exported regardless of the selected saving mode

  • if both source and bytecode are available then the selected saving mode is applied There will be no error produced if selected saving mode cannot be respected.

Parameters

~SaveFileConfig() noexcept

Destructor of SaveFileConfig

SaveFileConfig(const SaveFileConfig &other)

Copy Constructor of SaveFileConfig

Parameters
  • other: the other SaveFileConfig to copy from

SaveFileConfig(SaveFileConfig &&other) noexcept

Move Constructor of SaveFileConfig

Parameters
  • other: the other SaveFileConfig to move from

SaveFileConfig &operator=(const SaveFileConfig &other)

Assignment operator of SaveFileConfig

Return

self

Parameters
  • other: the other SaveFileConfig to copy from

SaveFileConfig &operator=(SaveFileConfig &&other) noexcept

Move assignment operator of SaveFileConfig

Return

self

Parameters
  • other: the other SaveFileConfig to move from

Public Members

std::unique_ptr<internal::SaveFileConfigImpl> m_impl

Implementation detail of SaveFileConfig