This API allows for efficient management of configuration .ini
files. It includes functions for reading, writing, and manipulating sections and keys within configuration files. It is designed to provide easy access to configuration data and modify it dynamically.
These functions are used to read data from a configuration .ini
file.
This function reads all the data from a configuration .ini
file and returns it in a cluster. The cluster contains three arrays:
- A 2D string array for the sections, where the first row stores the section names and the second row stores the number of keys in each section.
- A 1D string array for the key names.
- A 1D string array for the corresponding values.
This function retrieves all keys and their corresponding values from a specified section in a configuration .ini
file. Given the section name, the output is a cluster containing:
- A string for the section name.
- A 1D string array for the key names.
- A 1D string array for the corresponding values.
These functions are used to write data to a configuration .ini
file.
This function writes the complete data from the input cluster to a configuration .ini
file. The input cluster contains three arrays:
- A 2D string array for the sections, where the first row stores the section names and the second row stores the number of keys in each section.
- A 1D string array for the key names.
- A 1D string array for the corresponding values.
This function writes all keys and their corresponding values to a configuration .ini
file, given the section name. The input is a cluster containing:
- A string for the section name.
- A 1D string array for the key names.
- A 1D string array for the corresponding values.
These functions allow manipulation of keys in the configuration .ini
file.
This function removes all keys from a specified section in a configuration .ini
file, given the section name. The result in the .ini
file is the section without any keys, but the section itself remains.
These functions manage opening and closing configuration files.
This function opens a configuration .ini
file for reading or writing, given the file name as a string input. Internally, it uses the Application Directory.vi that returns the app directory, and build the full path for the configuration file. The function returns a Refnum to the opened configuration file.
This function closes the currently opened configuration .ini
file, destroying the associated Refnum. It ensures that the file is properly closed, and no further operations can be performed until the file is reopened.
The API includes two controls for managing the clusters used in reading and writing configuration data.
This control represents the cluster used for reading and writing the complete configuration data. It contains:
- A 2D string array for the section names and their respective key counts.
- A 1D string array for the key names.
- A 1D string array for the corresponding values.
This control represents the cluster used for handling data related to a single section. It contains:
- A string for the section name.
- A 1D string array for the key names.
- A 1D string array for the corresponding values.
The infographics below show the organization of the config data.ctl
and section data.ctl
clusters in relation to the .ini
file. On the right, the .ini
file layout is displayed, showing sections with keys and their corresponding values. On the left, the clusters are depicted, illustrating how the arrays are structured within the clusters. The two graphics provide a clear comparison of how the data is organized in both the clusters and the .ini
file.