Codebox Software
INIFile DLL
Published:
INIFile.DLL is a COM DLL providing easy access to INI files. The DLL encapsulates the Win32 API
functions GetPrivateProfileString
, WritePrivateProfileString
, GetPrivateProfileSection
and
WritePrivateProfileSection
allowing values and even whole sections to be read and written. The
library also provides some functionality not directly supported by the API - such as the deletion.
In addition, the various Sections and Keys within the INI file are represented by collections of objects, allowing for easy iteration through the data. Various 'helper' functions are also provided, allowing common tasks to be performed with a single method call. In addition, the library includes functions to encode binary data, such as byte-arrays, using only alpha-numeric characters that may be safely written to an INI file key.
Class Model for INIFile.DLL | ||
clsHelper | CreateNew | Function CreateNew(sFile As String, [sDirectory As String = ""]) As clsINIFile |
OpenExisting | Function OpenExisting(sFile As String, [sDirectory As String = ""]) As clsINIFile | |
clsINIFile | AddNewSection | Function AddNewSection(sSectionName As String) As clsSection |
DeleteKey | Sub DeleteKey(sSection As String, sKey As String) | |
DeleteSection | Sub DeleteSection(sSection As String) | |
File | Property File As String | |
GetSection | Function GetSection(sSection As String) As clsSection | |
GetValue | Function GetValue(sSection As String, sKey As String) As String | |
KeyExists | Function KeyExists(sSection As String, sKey As String) As Boolean | |
RetrieveByteArray | Function RetrieveByteArray(sSectionName As String, sKeyName As String) As Byte() | |
SectionExists | Function SectionExists(sSection As String) As Boolean | |
Sections | Property Sections As clsSections | |
SetValue | Sub SetValue(sSection As String, sKey As String, sValue As String) | |
StoreByteArray | Function StoreByteArray(sSectionName As String, sKeyName As String, arrData() As Byte) As clsKey | |
clsKey | Name | Property Name As String |
Value | Property Value As String | |
clsKeys | Add | Function Add(sKey As String, sValue As String) As clsKey |
Count | Property Count As Integer | |
Item | Function Item(sName As String) As clsKey | |
NewEnum | Function NewEnum() As IUnknown | |
Refresh | Sub Refresh() | |
Remove | Sub Remove(sKey As String) | |
clsSection | Keys | Property Keys As clsKeys |
Name | Property Name As String | |
clsSections | Add | Function Add(sSectionName As String) As clsSection |
Count | Property Count As Integer | |
Item | Function Item(sName As String) As clsSection | |
NewEnum | Function NewEnum() As IUnknown | |
Refresh | Sub Refresh() | |
Remove | Sub Remove(sSectionName As String) | |