yaml⚓︎
Provides support for interacting with yaml data, through the yaml-cpp library. The interface is a direct copy of the one found in OpenMW, to ensure compatibility. YAML is not recommended for any use outside of OpenMW compatibility.
Functions⚓︎
yaml.decode
⚓︎
Decode string representing yaml into a table.
local result = yaml.decode(input)
Parameters:
input
(string): The string to be decoded into a table.
Returns:
result
(table): The decoded table.
yaml.loadFile
⚓︎
Loads a yaml file from path
, using yaml.decode
. Unlike the related json.loadfile
function, this is relative to the current working directory, and not relative to Data Files\MWSE. A file extension should be part of the path
string.
local data, error = yaml.loadFile(path)
Parameters:
path
(string): The file to read from, relative to the current working directory (typically the Morrowind installation folder).
Returns:
data
(table?): The decoded data, ornil
if the file could not be found.error
(table?): Information about why the yaml file could not be decoded. This result will only be given if the operation fails.