Readers¶
Inlet has built-in support for three input file languages: JSON, Lua, and YAML. Due to language features, not all readers support all Inlet features. Below is a table that lists supported features:
JSON | Lua | YAML | |
---|---|---|---|
Primitive Types | bool, double, int, string | bool, double, int, string | bool, double, int, string |
Dictionaries | X | X | X |
Arrays | X | X | X |
Non-contiguous Arrays | X | ||
Mixed-typed key Arrays | X | ||
Callback Functions | X |
Extra Lua functionality¶
Inlet opens four Lua libraries by default: base
, math
, string
, package
. All libraries are
documented here.
For example, you can add the io library by doing this:
// Create Inlet Reader that supports Lua input files
auto lr = std::make_unique<axom::inlet::LuaReader>();
// Load extra io Lua library
lr->solState().open_libraries(sol::lib::io);
// Parse example input string
lr->parseString(input);