Class for loading Lua-based configuration files.
The following configuration file myapp.conf
is given as an example for
a program myapp
:
-- myapp.conf
myapp = {
database = "observ.sqlite" ,
node = "dummy-node" ,
verbose = true
}
In Fortran, open the configuration file and read the settings with class
method get()
:
character ( len = :), allocatable :: database , node
integer :: rc
logical :: verbose
type ( config_class ) :: config
rc = config % open ( 'myapp.conf' , 'myapp' )
if ( dm_is_ok ( rc )) then
call config % get ( 'database' , database )
call config % get ( 'node' , node )
call config % get ( 'verbose' , verbose )
end if
call config % close ()
module~~dm_config~~UsesGraph
module~dm_config
dm_config
module~dm_error
dm_error
module~dm_config->module~dm_error
module~dm_id
dm_id
module~dm_config->module~dm_id
module~dm_kind
dm_kind
module~dm_config->module~dm_kind
module~dm_lua
dm_lua
module~dm_config->module~dm_lua
module~dm_string
dm_string
module~dm_config->module~dm_string
module~dm_util
dm_util
module~dm_config->module~dm_util
module~dm_error->module~dm_kind
module~dm_ascii
dm_ascii
module~dm_error->module~dm_ascii
iso_fortran_env
iso_fortran_env
module~dm_kind->iso_fortran_env
module~dm_lua->module~dm_error
module~dm_lua->module~dm_kind
module~dm_lua->module~dm_string
module~dm_lua->module~dm_util
iso_c_binding
iso_c_binding
module~dm_lua->iso_c_binding
lua
lua
module~dm_lua->lua
module~dm_file
dm_file
module~dm_lua->module~dm_file
module~dm_string->module~dm_error
module~dm_string->module~dm_kind
module~dm_util->module~dm_error
module~dm_util->module~dm_kind
module~dm_file->module~dm_error
module~dm_file->module~dm_kind
Nodes of different colours represent the following:
Graph Key
Module
Module
Submodule
Submodule
Subroutine
Subroutine
Function
Function
Program
Program
This Page's Entity
This Page's Entity
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses.
module~~dm_config~~UsedByGraph
module~dm_config
dm_config
module~dmpack
dmpack
module~dmpack->module~dm_config
Nodes of different colours represent the following:
Graph Key
Module
Module
Submodule
Submodule
Subroutine
Subroutine
Function
Function
Program
Program
This Page's Entity
This Page's Entity
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses.
Derived Types
Opaque file configuration class.
Type-Bound Procedures
procedure, public ::
close => config_close
procedure, public ::
field => config_field
generic, public ::
get => get_array_int32, get_array_int64, get_array_string, get_int32, get_int64, get_job_list, get_logical, get_real32, get_real64, get_report, get_string
procedure, public ::
open => config_open
procedure, public ::
remove => config_remove
procedure, public ::
size => config_size