Joutsen v0.5.0+18-g5fdf104
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Joutsen.Configuration.JsonApplicationConfiguration Class Reference

An application configuration read from a JSON file. More...

Public Member Functions

 JsonApplicationConfiguration (IConfiguration config, String section)
 Creates a new instance for a section from a configuration.
 
String GetValue (String key)
 Fetches a value identified by a key as a string.
 
ValueType GetValue< ValueType > (String key)
 Fetches a value identified by a key as a specific type.
 
ValueType GetValue< ValueType > (String key, SimpleTypeConverter< string, ValueType > converter)
 Fetches a value identified by a key as a specific type.
 
SectionType GetSection< SectionType > (String sectionName)
 Fetches a section from the configuration.
 

Detailed Description

An application configuration read from a JSON file.

Since
0.5.0

Constructor & Destructor Documentation

◆ JsonApplicationConfiguration()

Joutsen.Configuration.JsonApplicationConfiguration.JsonApplicationConfiguration ( IConfiguration  config,
String  section 
)

Creates a new instance for a section from a configuration.

Member Function Documentation

◆ GetSection< SectionType >()

SectionType Joutsen.Configuration.JsonApplicationConfiguration.GetSection< SectionType > ( String  sectionName)

Fetches a section from the configuration.

Implements Joutsen.Configuration.ApplicationConfiguration.

Type Constraints
SectionType :global 
SectionType :System.Configuration.ConfigurationSection 

◆ GetValue()

String Joutsen.Configuration.JsonApplicationConfiguration.GetValue ( String  key)

Fetches a value identified by a key as a string.

Implements Joutsen.Configuration.ApplicationConfiguration.

◆ GetValue< ValueType >() [1/2]

ValueType Joutsen.Configuration.JsonApplicationConfiguration.GetValue< ValueType > ( String  key)

Fetches a value identified by a key as a specific type.

Implements Joutsen.Configuration.ApplicationConfiguration.

Type Constraints
ValueType :IConvertible 

◆ GetValue< ValueType >() [2/2]

ValueType Joutsen.Configuration.JsonApplicationConfiguration.GetValue< ValueType > ( String  key,
SimpleTypeConverter< string, ValueType >  converter 
)

Fetches a value identified by a key as a specific type.

Parameters
keythe configuration key
converterthe converter used to convert the read string into a specific type
Returns
the value as the converted type

Implements Joutsen.Configuration.ApplicationConfiguration.