C# Class Yava.FoldersFile.FoldersFileReader

Inheritance: mINI.INIReader
Mostra file Open project: Beluki/Yava Class Usage Examples

Public Methods

Method Description
FoldersFileReader ( ) : System

An INIReader that reads lines from a folders file adding sections and key=value pairs to a collection as folder names/options.

Read ( String filepath, IList folders ) : void

Read a folders file adding each folder with its options to a collection.

Protected Methods

Method Description
OnEmpty ( ) : void

On an empty line, add the current folder to the collection and move on to the next one.

OnKeyEmpty ( String value ) : void

Do not accept options with no name.

OnKeyValue ( String key, String value ) : void

Set key=value pairs as options to the current folder.

OnSection ( String section ) : void

On a new section, add the current folder to the collection and create the next one.

OnSectionEmpty ( ) : void

Do not accept folders with no name.

OnUnknown ( String line ) : void

Syntax errors.

OnValueEmpty ( String key ) : void

Options without value are fine. (each option validates its own value in OnKeyValue)

Private Methods

Method Description
AddCurrentFolder ( ) : void

Add the current folder to the list and move on to the next.

ReadError ( String message ) : FoldersFileReadError

Concise helper to create FoldersFileReadError exceptions.

ReadFolderExecutable ( String value ) : String

Try to parse a folder executable option.

ReadFolderExtensions ( String value ) : HashSet

Try to parse a folder extensions option.

ReadFolderParameters ( String value ) : String

Try to parse folder parameters option.

ReadFolderPath ( String value ) : String

Try to parse a folder path option.

ReadFolderWorkingDirectory ( String value ) : String

Try to parse folder workingdirectory option.

ResetState ( ) : void

Clear internal state.

Method Details

FoldersFileReader() public method

An INIReader that reads lines from a folders file adding sections and key=value pairs to a collection as folder names/options.
public FoldersFileReader ( ) : System
return System

OnEmpty() protected method

On an empty line, add the current folder to the collection and move on to the next one.
protected OnEmpty ( ) : void
return void

OnKeyEmpty() protected method

Do not accept options with no name.
protected OnKeyEmpty ( String value ) : void
value String
return void

OnKeyValue() protected method

Set key=value pairs as options to the current folder.
protected OnKeyValue ( String key, String value ) : void
key String
value String
return void

OnSection() protected method

On a new section, add the current folder to the collection and create the next one.
protected OnSection ( String section ) : void
section String
return void

OnSectionEmpty() protected method

Do not accept folders with no name.
protected OnSectionEmpty ( ) : void
return void

OnUnknown() protected method

Syntax errors.
protected OnUnknown ( String line ) : void
line String
return void

OnValueEmpty() protected method

Options without value are fine. (each option validates its own value in OnKeyValue)
protected OnValueEmpty ( String key ) : void
key String
return void

Read() public method

Read a folders file adding each folder with its options to a collection.
public Read ( String filepath, IList folders ) : void
filepath String Path to the file to read lines from.
folders IList Target list to add folders to.
return void