You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
configreader/configfile.h

41 lines
1.7 KiB

#ifndef __CONFIGFILE_H
#define __CONFIGFILE_H
#include <exec/types.h>
#include <dos/dos.h>
#include <proto/containerkit.h>
typedef APTR CONFIGFILEPTR;
// added the BPTR version so we can use WorkspaceOpenFile.
// We still need a file name to be able to save though I should probably
// get that from the file
CONFIGFILEPTR ConfigFileRead(BPTR configFile);
CONFIGFILEPTR ConfigFileReadName(CONST_STRPTR filename);
VOID ConfigFileFree(CONFIGFILEPTR configFile);
Array ConfigFileGetAll(CONFIGFILEPTR abstractConfigFile, CONST_STRPTR compoundKey);
STRPTR ConfigFileGet(CONFIGFILEPTR abstractConfigFile, CONST_STRPTR compoundKey);
BOOL ConfigFileSet(CONFIGFILEPTR abstractConfigFile, CONST_STRPTR compoundKey, CONST_STRPTR stringValue);
// --add
VOID ConfigFileAddVariable(CONFIGFILEPTR abstractConfigFile, CONST_STRPTR compoundKey, CONST_STRPTR stringValue);
// --replace-all
VOID ConfigFileReplaceAll(CONFIGFILEPTR abstractConfigFile, CONST_STRPTR compoundKey, CONST_STRPTR stringValue);
// --unset
VOID ConfigFileUnset(CONFIGFILEPTR abstractConfigFile, CONST_STRPTR compoundKey, CONST_STRPTR stringValue);
// --unset-all
VOID ConfigFileUnsetAll(CONFIGFILEPTR abstractConfigFile, CONST_STRPTR compoundKey, CONST_STRPTR stringValue);
// --remove-section
VOID ConfigFileRemoveSection(CONFIGFILEPTR abstractConfigFile, CONST_STRPTR canonicalName);
VOID ConfigFileDump(CONFIGFILEPTR configFile);
VOID ConfigFileSaveOverwrite(CONFIGFILEPTR configFile);
VOID ConfigFileSaveCopyTo(CONFIGFILEPTR configFile, STRPTR newFilename);
VOID ConfigFileWrite(CONFIGFILEPTR abstractConfigFile, BPTR file);
Array ConfigFileSubsectionsForSection(CONFIGFILEPTR abstractConfigFile, CONST_STRPTR primarySection);
#endif