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

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

Private Properties

Свойство Type Description
GetErrorMessage string
IsCommentOrBlank bool
IsProperty bool
IsSection bool
SeekProperty bool
SeekSection bool
TryParseProperty bool
TryParseSection bool
TrySeekSection bool
TrySeekSection bool
Validate void

Méthodes publiques

Méthode 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

Méthode 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 méthode

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

EditSection() public méthode

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
Résultat void

EnsureSectionExists() public méthode

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
Résultat void

IniFile() public méthode

Construct a new IniFile.
public IniFile ( string filePath ) : System
filePath string path of the IniFile
Résultat System

ListSectionNames() public méthode

public ListSectionNames ( ) : HashSet
Résultat HashSet

Persist() public méthode

Persist the changes to this INI file to disk.
public Persist ( ) : void
Résultat void

SectionExists() public méthode

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

ToString() public méthode

public ToString ( ) : string
Résultat string

TryGetSection() public méthode

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
Résultat bool

TryGetSection() public méthode

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
Résultat bool

TryGetSection() public méthode

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
Résultat bool