C# Класс iniParser, Unity_tools

An .ini file parser that Creates and edits .ini files, With functions to fetch and delete values.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

Clear() публичный Метод

Clear this instance.
public Clear ( ) : void
Результат void

Count() публичный Метод

How many keys are stored.
public Count ( ) : int
Результат int

DoesExist() публичный Метод

Returns true if the file exists, or false if it doesnt.
public DoesExist ( IniFiles, file ) : bool
file IniFiles, The selected file.
Результат bool

Get() публичный Метод

Returns the value for the input variable.
public Get ( string key ) : string
key string The variable name.
Результат string

Get() публичный Метод

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.
Результат string

GetLine() публичный Метод

Returns the Key, Value, subsection and comment of the choosen variable.
public GetLine ( string key ) : string[]
key string The variable name.
Результат string[]

Load() публичный Метод

Load the specified file.
public Load ( IniFiles, file ) : void
file IniFiles, The file name.
Результат void

Remove() публичный Метод

Removes the selected Variable including its value and comment.
public Remove ( string key ) : void
key string The variable name.
Результат void

Remove() публичный Метод

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
Результат void

Save() публичный Метод

Save the specified file.
public Save ( IniFiles, file ) : void
file IniFiles, The file name.
Результат void

Set() публичный Метод

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
Результат void

Set() публичный Метод

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
Результат void

iniParser() публичный Метод

Initializes a new instance of the iniParser class without loading a file.
public iniParser ( ) : System.Collections.Generic
Результат System.Collections.Generic

iniParser() публичный Метод

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.
Результат System.Collections.Generic