Skip to content

uriid1/lua-ini

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Info

Simple and small library for your ini.
Support for load and saving ini files.
Warning: there is no support for load and save comments. Because it doesn't make sense.

File format

; One line comment
# Unix style comment

; Global var
programName = "Cool Game"
__version = 1.1

; Comment
[section_name]
speed = 100     ; Game speed
gravity = 0.1   # Game gravity

[all_types_TEST]
var_int = 123
var_float = 1.23
var_bool = true
var_char = 'A'
var_string = "Awesome ini!"
var_arr[] = 1, 2, 3, 4, 5
var_arr_fruits[] = apple, banana, orange
var_arr_mutate[] = 1, banana, 2, orange

Usage example

local ini = require 'ini'
local conf = ini.parse 'conf_test.ini'

-- Test
print(conf.__verion)
print(conf.section_name.speed)
print(conf.section_name.gravity)

About

Simple ini parser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages