C# Class iniParser, Unity_tools

An .ini file parser that Creates and edits .ini files, With functions to fetch and delete values.
显示文件 Open project: kennyist/Unity_tools Class Usage Examples

Public Methods

Method Description
Clear ( ) : void

Clear this instance.

Count ( ) : int

How many keys are stored.

DoesExist ( IniFiles, file ) : bool

Returns true if the file exists, or false if it doesnt.

Get ( string key ) : string

Returns the value for the input variable.

Get ( string subSection, string key ) : string

Get the specified key from a subSection. For use if you need to use the same name in differant sections.

GetLine ( string key ) : string[]

Returns the Key, Value, subsection and comment of the choosen variable.

Load ( IniFiles, file ) : void

Load the specified file.

Remove ( string key ) : void

Removes the selected Variable including its value and comment.

Remove ( string subSection, string key ) : void

Remove the specified key from the specified subSection.

Save ( IniFiles, file ) : void

Save the specified file.

Set ( string subSection, string key, string value ) : void

Set the variable and value if they dont exist. Updates the variables value if does exist.

Set ( string subSection, string key, string value, string comment ) : void

Set the variable and value if they dont exist including a comment. Updates the variables value and comment if does exist.

iniParser ( ) : System.Collections.Generic

Initializes a new instance of the iniParser class without loading a file.

iniParser ( IniFiles, file ) : System.Collections.Generic

Initializes a new instance of the iniParser class with loading a file.

Method Details

Clear() public method

Clear this instance.
public Clear ( ) : void
return void

Count() public method

How many keys are stored.
public Count ( ) : int
return int

DoesExist() public method

Returns true if the file exists, or false if it doesnt.
public DoesExist ( IniFiles, file ) : bool
file IniFiles, The selected file.
return bool

Get() public method

Returns the value for the input variable.
public Get ( string key ) : string
key string The variable name.
return string

Get() public method

Get the specified key from a subSection. For use if you need to use the same name in differant sections.
public Get ( string subSection, string key ) : string
subSection string Sub section.
key string Key.
return string

GetLine() public method

Returns the Key, Value, subsection and comment of the choosen variable.
public GetLine ( string key ) : string[]
key string The variable name.
return string[]

Load() public method

Load the specified file.
public Load ( IniFiles, file ) : void
file IniFiles, The file name.
return void

Remove() public method

Removes the selected Variable including its value and comment.
public Remove ( string key ) : void
key string The variable name.
return void

Remove() public method

Remove the specified key from the specified subSection.
public Remove ( string subSection, string key ) : void
subSection string Sub section name.
key string The key name
return void

Save() public method

Save the specified file.
public Save ( IniFiles, file ) : void
file IniFiles, The file name.
return void

Set() public method

Set the variable and value if they dont exist. Updates the variables value if does exist.
public Set ( string subSection, string key, string value ) : void
subSection string The Section this key belongs to
key string The variable nameThe value of the variable
value string
return void

Set() public method

Set the variable and value if they dont exist including a comment. Updates the variables value and comment if does exist.
public Set ( string subSection, string key, string value, string comment ) : void
subSection string The Section this key belongs to
key string The variable name
value string
comment string The comment of the variable
return void

iniParser() public method

Initializes a new instance of the iniParser class without loading a file.
public iniParser ( ) : System.Collections.Generic
return System.Collections.Generic

iniParser() public method

Initializes a new instance of the iniParser class with loading a file.
public iniParser ( IniFiles, file ) : System.Collections.Generic
file IniFiles, Name of the file you want to load.
return System.Collections.Generic