IniFile Class

IniFileIO

IniFile Class

IniFileIO Documentation
Library for handling reading and manipulation of Ini files.
Inheritance Hierarchy

SystemObject  IniFileIOIniFile

Namespace:  IniFileIO
Assembly:  IniFileIO (in IniFileIO.dll) Version: 1.4.0.6028 (1.4.0.06028)
Syntax

public class IniFile
Public Class IniFile
public ref class IniFile
type IniFile =  class end

The IniFile type exposes the following members.

Constructors

  NameDescription
Public methodIniFile
Creates a new object with the read/write path set by fileName.
Top
Properties

  NameDescription
Public propertyFileName
The file path where the object will be read from and written to.
Public propertyKeyNameWhitespaceLiteral
Specifies if the parser includes leading and trailing whitespaces from the source in the Name property.
Public propertyKeyValueWhitespaceLiteral
Specifies if the parser includes leading and trailing whitespaces from the source in the Value property.
Public propertySections
Raw section data stored by the object.
Top
Methods

  NameDescription
Public methodAddKey(String, IniFileKey)
Adds the key to the specified sectionName.
Public methodAddKey(String, String, String, String, Int32)
Creates a new IniFileKey with the passed in values and adds it to the specified sectionName.
Public methodAddSection(IniFileSection)
Adds the section to the object.
Public methodAddSection(String, String, Int32)
Creates a new IniFileSection with the passed in values.
Public methodStatic memberCreateFromString
Creates a new object from the provided text contents.
Public methodDeleteKey
Deletes the key with the name keyName from the specified sectionName.
Public methodDeleteSection
Deletes the section with the specified name.
Public methodDeleteSectionKeys
Deletes all keys from the section with the specified name.
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetAllKeys
Returns the all the keys matching keyName in the specified sectionName.
Public methodGetAllKeysWithAName
Returns the all the keys within sectionName which have a non-empty Name.
Public methodGetAllKeysWithAValue
Returns the all the keys matching keyName in the specified sectionName which have a non-empty Value.
Public methodGetAllSections
Returns the all the sections with the specified name in the object.
Public methodStatic memberGetCommentOutput
Gets the comment output for writing to a file.
Public methodGetHashCode (Inherited from Object.)
Public methodGetKey
Returns the full key within the specified sectionName. If the key does not exist, an empty IniFileKey is returned.
Public methodGetKeyComments
Returns the comments of keyName within the specified sectionName.
Public methodGetKeyOrder
Gets the order of keyName in the specified sectionName.
Public methodStatic memberGetKeyOutput
Gets the IniFileKey output which is written to the ini file.
Public methodGetKeyValue(String, String, String)
Gets the value of keyName in the specified sectionName.
Public methodStatic memberGetKeyValue(IniFileSection, String, String)
Gets the value of keyName in the specified section.
Public methodGetOutputString(Boolean)
Returns the current object content as a single string.
Private methodGetOutputString(ListIniFileSection, Boolean, Boolean)
Helper method which generates the output content.
Public methodGetSection
Returns the section with the specified name. If the section does not exist, an empty IniFileSection is returned.
Public methodGetSectionComments
Returns the comments of the section with the specified name.
Public methodGetSectionKeys
Returns the all the keys in the section with the specified name.
Public methodGetSectionOrder
Returns the order of the section with the specified name.
Public methodStatic memberGetSectionOutput
Gets the IniFileSection output which is written to the ini file.
Public methodGetType (Inherited from Object.)
Public methodStatic memberKeyHasData
Returns whether or not the supplied key contains data.
Public methodKeyNameCount
Returns the count of keys with the name keyName appearing in sectionName.
Public methodKeyNameExists
Returns whether or not a key with the name keyName exists in sectionName.
Public methodStatic memberMakeKey
Creates a new unattached IniFileKey.
Public methodStatic memberMakeSection
Creates a new unattached IniFileSection.
Protected methodMemberwiseClone (Inherited from Object.)
Public methodReadFile
Reads the current contents of FileName into the object.
Public methodSaveFile
Writes the current object content to FileName.
Public methodStatic memberSectionHasData
Returns whether or not the supplied section contains data.
Public methodSectionNameCount
Returns the count of sections with the specified name.
Public methodSectionNameExists
Returns whether or not a section with the specified name exists.
Public methodStatic memberSectionToDictionary
Returns a dictionary lookup for the provided section's Keys.

This method does not support multiple IniFileKey with the same Name value. An exception is thrown when this is attempted.

Public methodStatic memberSectionToKeyValuePair
Returns an array of key value pairs representing each IniFileKey in the provided section.

This method supports multiple IniFileKeys with the same Name value.

Public methodSetKeyData
Sets the data of the key with keyName within the specified IniFileSection. Optionally, this method will create the section and/or key as needed.
Public methodSetSectionData
Sets the comments of the section with the specified name.
Public methodToDictionary
Returns a dictionary lookup by Name for the currently loaded IniFileSections. The inner dictionary lookup is by Name for each IniFileSection's Keys.

This method does not support multiple IniFileSections with the same Name value nor does it support a single IniFileSection which has multiple IniFileKeys with the same Name value. An exception is thrown when this is encountered.

Public methodToKeyValuePair
Returns an array of key value pairs by Name for the currently loaded IniFileSections. The inner array of key value pairs is by IniFileKeyName for each IniFileSection.

This method supports multiple IniFileSections with the same Name value as well as a single IniFileSection which has multiple IniFileKeys with the same Name value.

Public methodToString (Inherited from Object.)
Top
Fields

  NameDescription
Private field_nameWhitespaceLiteral
Specifies whether the key name portion of the key is whitespace sensitive.
Private field_sections
Internal list of IniFileSections in the file.
Private field_valueWhitespaceLiteral
Specifies whether the value portion of the key is whitespace sensitive.
Private fieldStatic memberCOMMENT
Token at the beginning of a line which denotes a comment. (';' character.)
Private fieldStatic memberKEY_VALUE_SEPARATOR
Token within a IniFileKey which defines the separation of the Name and Value. ('=' character.). Only the first token encountered in a line is processed (so the Value can contain this token in its text).
Private fieldStatic memberSECTION_BEGIN
Token at the beginning of a line which denotes a IniFileSection name start. ('[' character.)
Private fieldStatic memberSECTION_END
Token at the end of a line which denotes a IniFileSection name end. (']' character.)
Top
Remarks

See Also

Reference