TaskParameters 8.1.12
Compiled `c` library for task parameter data structures and functions.
|
Handling of parameter file read and write operations + parameters.txt
file structure.
More...
Functions | |
const char * | findMostRecentParameters (const char *subject, char *searchFolder) |
Function to find the most recent parameters filename for a given subject. | |
void | parseParameterFile (const char *filename, TaskParameters *params) |
Parses a parameter file and populates a TaskParameters struct. | |
void | writeParameterFile (const char *filename, const TaskParameters *params) |
Writes task parameters to a parameter file. | |
Handling of parameter file read and write operations + parameters.txt
file structure.
All parameter files are UTF-8
-encoded tab-separated-value (.tsv) files.
To generate an example parameter text file, you should compile and run bin\gen_params.exe
and view how it is read using bin\test_params.exe
to ensure that the parameter format is working as expected.
As of 2024-02-24, the following structure is expected in the `
const char * findMostRecentParameters | ( | const char * | subject, |
char * | searchFolder ) |
Function to find the most recent parameters filename for a given subject.
If no parameter .tsv
file exists within searchFolder
, return NULL instead. Parameter files are expected to have the name convention: Subject
_YYYY
_MM
_DD
_Tag
_Index
.tsv Therefore, first all files for Subject
are found. Next, only files from the most recent date (YYYY-MM-DD) are considered. Finally, use the file with the largest Index
value. The returned name should be the full filename (including path).
subject | The subject for which to find the most recent parameters file. |
searchFolder | The folder in which to search for the parameters files. |
void parseParameterFile | ( | const char * | filename, |
TaskParameters * | params ) |
Parses a parameter file and populates a TaskParameters struct.
filename | The name of the parameter file. |
params | Pointer to the TaskParameters struct to populate. |
void writeParameterFile | ( | const char * | filename, |
const TaskParameters * | params ) |
Writes task parameters to a parameter file.
This function writes the given task parameters to a parameter file with the specified filename.
filename | The name of the parameter file to write. |
params | Pointer to the TaskParameters struct containing the parameters to write. |