C# Class Amazon.Runtime.Internal.Util.IniFile

Provides read/write access to a file in the INI format. This class is not threadsafe.
Mostra file Open project: aws/aws-sdk-net

Private Properties

Property Type Description
GetErrorMessage string
IsCommentOrBlank bool
IsProperty bool
IsSection bool
SeekProperty bool
SeekSection bool
TryParseProperty bool
TryParseSection bool
TrySeekSection bool
TrySeekSection bool
Validate void

Public Methods

Method Description
DeleteSection ( string sectionName ) : void

If the section exists, delete it from the INI file.

EditSection ( string sectionName, string>.List properties ) : void

Update the section with the properties given. If the section doesn't exist, it will be appended to the file. -Any properties that do exist in the section will be updated. -A null value for a property denotes that it should be deleted from the section -If any properties don't exist they will be appended to the end of the section in the same order they appear in the list.

EnsureSectionExists ( string sectionName ) : void

Check if the section exists. If not, append it to the end of the file.

IniFile ( string filePath ) : System

Construct a new IniFile.

ListSectionNames ( ) : HashSet
Persist ( ) : void

Persist the changes to this INI file to disk.

SectionExists ( string sectionName ) : bool

Determine if a section exists in the INI file.

ToString ( ) : string
TryGetSection ( Regex sectionNameRegex, string>.Dictionary &properties ) : bool

Return the properties for the section if it exists.

TryGetSection ( Regex sectionNameRegex, string &sectionName, string>.Dictionary &properties ) : bool

Return the properties for the section if it exists.

TryGetSection ( string sectionName, string>.Dictionary &properties ) : bool

Return the properties for the section if it exists.

Private Methods

Method Description
GetErrorMessage ( int lineNumber ) : string
IsCommentOrBlank ( string line ) : bool
IsProperty ( string line ) : bool
IsSection ( string line ) : bool
SeekProperty ( int &lineNumber, string &propertyName, string &propertyValue ) : bool
SeekSection ( int &lineNumber, string &sectionName ) : bool
TryParseProperty ( string line, string &propertyName, string &propertyValue ) : bool
TryParseSection ( string line, string &sectionName ) : bool
TrySeekSection ( Regex sectionNameRegex, int &lineNumber, string &sectionName ) : bool
TrySeekSection ( String sectionName, int &lineNumber ) : bool
Validate ( ) : void

Method Details

DeleteSection() public method

If the section exists, delete it from the INI file.
public DeleteSection ( string sectionName ) : void
sectionName string section to delete
return void

EditSection() public method

Update the section with the properties given. If the section doesn't exist, it will be appended to the file. -Any properties that do exist in the section will be updated. -A null value for a property denotes that it should be deleted from the section -If any properties don't exist they will be appended to the end of the section in the same order they appear in the list.
public EditSection ( string sectionName, string>.List properties ) : void
sectionName string name of the section to operate on
properties string>.List ordered list of properties to add/update/delete
return void

EnsureSectionExists() public method

Check if the section exists. If not, append it to the end of the file.
public EnsureSectionExists ( string sectionName ) : void
sectionName string section to ensure exists
return void

IniFile() public method

Construct a new IniFile.
public IniFile ( string filePath ) : System
filePath string path of the IniFile
return System

ListSectionNames() public method

public ListSectionNames ( ) : HashSet
return HashSet

Persist() public method

Persist the changes to this INI file to disk.
public Persist ( ) : void
return void

SectionExists() public method

Determine if a section exists in the INI file.
public SectionExists ( string sectionName ) : bool
sectionName string name of section to look for
return bool

ToString() public method

public ToString ( ) : string
return string

TryGetSection() public method

Return the properties for the section if it exists.
public TryGetSection ( Regex sectionNameRegex, string>.Dictionary &properties ) : bool
sectionNameRegex System.Text.RegularExpressions.Regex Regex to match name of section to get
properties string>.Dictionary properties contained in the section
return bool

TryGetSection() public method

Return the properties for the section if it exists.
public TryGetSection ( Regex sectionNameRegex, string &sectionName, string>.Dictionary &properties ) : bool
sectionNameRegex System.Text.RegularExpressions.Regex Regex to match name of section to get
sectionName string name of section if regex matches
properties string>.Dictionary properties contained in the section
return bool

TryGetSection() public method

Return the properties for the section if it exists.
public TryGetSection ( string sectionName, string>.Dictionary &properties ) : bool
sectionName string name of section to get
properties string>.Dictionary properties contained in the section
return bool