Module loadconf

A module for loading LOVE conf.lua files.

Functions

parse_string (str, name, opts) Given the string contents of a conf.lua, returns a table containing the configuration it represents.
parse_file (fname, opts) Given the filename of a valid conf.lua file, returns a table containing the configuration it represents.
new (opts) Create an instanced version of loadconf.

Tables

love_config The configuration tables produced by running love.conf.
options The optional table all loadconf functions take.
defaults A table containing the default config tables for each version of love.

Fields

stable_love The current stable love version, which right now is "11.3".

Class Loadconf

Loadconf:parse_string (str, name)
Loadconf:parse_file (fname)


Functions

parse_string (str, name, opts)
Given the string contents of a conf.lua, returns a table containing the configuration it represents.

Parameters:

  • str The contents of conf.lua
  • name The name of conf.lua used in error messages. Uses same format as load. Optional.
  • opts options A configuration table. Optional.

Returns:

    love_config

Or

  1. nil
  2. string
parse_file (fname, opts)
Given the filename of a valid conf.lua file, returns a table containing the configuration it represents.

Parameters:

  • fname The path to the conf.lua file
  • opts options A configuration table. Optional.

Returns:

    love_config

Or

  1. nil
  2. string
new (opts)
Create an instanced version of loadconf. This carries its configuration state in object-oriented way, if you prefer that.

Parameters:

Returns:

    a Loadconf instance

Tables

love_config
The configuration tables produced by running love.conf.

See also:

options
The optional table all loadconf functions take. customize according to your use case.

Fields:

  • program What is the program called? Used for friendly errors (default "loadconf")
  • friendly Enable user-friendly errors (default false)
  • include_defaults Return default values in parsed configs (default false)
defaults
A table containing the default config tables for each version of love.

Usage:

    assert(loadconf.defaults["0.9.2"].window.fullscreentype == "normal")

Fields

stable_love
The current stable love version, which right now is "11.3". Please submit an issue/pull request if this is out of date, sorry~

Class Loadconf

An object-oriented instance of the loadconf module. This carries configuration state internally so you can set-and-forget the options table.
Loadconf:parse_string (str, name)

Parameters:

  • str
  • name

See also:

Loadconf:parse_file (fname)

Parameters:

  • fname

See also:

generated by LDoc 1.4.6 Last updated 2020-10-18 04:17:46