Big Tony
BigTony.Core.SettingsParser Class Reference

Static Public Member Functions

static string GenerateConfigFile ()
 
static void SetParam (string label, string value)
 Set the value at the specified label. More...
 
static string GetStringParam (string label)
 Get the value at a specified label. More...
 
static bool GetBoolParam (string label)
 Get the value at a specified label. More...
 
static void PrintSettings ()
 Print all of the current settings in the system. More...
 
static void ParseFile (string path)
 Open and parse a Big Tony settings file. More...
 
static void SetParams (string[] args)
 This function is run whenever the program starts to setup the settings. More...
 
static void ParseString (string data)
 Parse a file's data as a Big Tony config file. More...
 

Static Private Attributes

static Dictionary< string, string > settings
 The Dictionary that stores all of the Big Tony settings for the program during rumtime. More...
 
static Dictionary< string, string > settingDescriptions
 

Member Function Documentation

◆ GenerateConfigFile()

static string BigTony.Core.SettingsParser.GenerateConfigFile ( )
inlinestatic

◆ GetBoolParam()

static bool BigTony.Core.SettingsParser.GetBoolParam ( string  label)
inlinestatic

Get the value at a specified label.

Parameters
labelThe label to get the data at.
Returns
The value at the specified label.

◆ GetStringParam()

static string BigTony.Core.SettingsParser.GetStringParam ( string  label)
inlinestatic

Get the value at a specified label.

Parameters
labelThe label to get the data at.
Returns
The value at the specified label.

◆ ParseFile()

static void BigTony.Core.SettingsParser.ParseFile ( string  path)
inlinestatic

Open and parse a Big Tony settings file.

This function opens up the file of the specified path and then parses it using the 'ParseString' fuction. This file needs to be formatted using the Settings File Markup. This means that comments start with a hashtag, and only lines that contain data on them are parsed. The data needs to be formatted as 'KEY = VALUE'. An example of this would be, 'HTTP_SERVER = NO'.

Parameters
pathThe relative or absolute path to the settings file.

◆ ParseString()

static void BigTony.Core.SettingsParser.ParseString ( string  data)
inlinestatic

Parse a file's data as a Big Tony config file.

Parameters
dataThe string data to be parsed.

◆ PrintSettings()

static void BigTony.Core.SettingsParser.PrintSettings ( )
inlinestatic

Print all of the current settings in the system.

This includes the default settings that have not been set by the user.

◆ SetParam()

static void BigTony.Core.SettingsParser.SetParam ( string  label,
string  value 
)
inlinestatic

Set the value at the specified label.

Parameters
labelThe key or label for the data that needs to be set.
valueThe value that the data will be set to.

◆ SetParams()

static void BigTony.Core.SettingsParser.SetParams ( string[]  args)
inlinestatic

This function is run whenever the program starts to setup the settings.

Parameters
argsThe list of Command Line Arguments that are given by the user.

Member Data Documentation

◆ settingDescriptions

Dictionary<string, string> BigTony.Core.SettingsParser.settingDescriptions
staticprivate
Initial value:
= new Dictionary<string, string>() {
{ "UDP_SERVER", "This option is to create an UDP Server. Please note that to do this in the API, the option has to be enabled here." },
{ "CONFIG_COMMAND", "If this option is set to 'No', the server will not respond when the user asks for the config file. If set to yes, the entire current config will be sent to the user if requested." }
}

◆ settings

Dictionary<string, string> BigTony.Core.SettingsParser.settings
staticprivate
Initial value:
= new Dictionary<string, string>() {
{ "UDP_SERVER", "Yes" },
{ "CONFIG_COMMAND", "No" }
}

The Dictionary that stores all of the Big Tony settings for the program during rumtime.