|
|
|
@ -130,6 +130,25 @@ StringArray ConfigFileSplitKey(CONST_STRPTR key) |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
STRPTR ConfigFileGet(CONFIGFILEPTR abstractConfigFile, CONST_STRPTR compoundKey) |
|
|
|
|
{ |
|
|
|
|
STRPTR result = NULL; |
|
|
|
|
struct ConfigFile* configFile = (struct ConfigFile*)abstractConfigFile; |
|
|
|
|
if( configFile != NULL ) |
|
|
|
|
{ |
|
|
|
|
StringArray split = ConfigFileSplitKey(compoundKey); |
|
|
|
|
VARIABLEPTR var = SectionStoreGet(configFile->sectionStore, StringArrayValues(split)[0], StringArrayValues(split)[1]); |
|
|
|
|
if( var != NULL ) |
|
|
|
|
{ |
|
|
|
|
CONST_STRPTR value = VariableGetRawValue(var); |
|
|
|
|
result = AllocVec(strlen(value)+1, MEMF_CLEAR); |
|
|
|
|
CopyMem(value, result, strlen(value)); |
|
|
|
|
} |
|
|
|
|
StringArrayFree(split, TRUE); |
|
|
|
|
} |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
StringArray ConfigFileGetAll(CONFIGFILEPTR abstractConfigFile, CONST_STRPTR compoundKey) |
|
|
|
|
{ |
|
|
|
|
StringArray result = StringArrayNew(); |
|
|
|
|