23#ifndef BAGEL_BOFLIB_OPTIONS_H
24#define BAGEL_BOFLIB_OPTIONS_H
26#include "common/stream.h"
28#include "bagel/boflib/stdinc.h"
29#include "bagel/boflib/llist.h"
30#include "bagel/boflib/object.h"
31#include "bagel/boflib/error.h"
36#define MAX_OPTION_LEN 100
40 COption(
const char *pszInit =
nullptr);
42 char _szBuf[MAX_OPTION_LEN];
52 COption *findSection(
const char *pszSection);
60 COption *findOption(
const char *pszSection,
const char *pszVar);
70 char _szFileName[MAX_FNAME];
101 const char *getFileName()
const {
102 return ((
const char *)_szFileName);
112 ErrorCode
writeSetting(
const char *pszSection,
const char *pszOption,
const char *pszValue);
121 ErrorCode
writeSetting(
const char *pszSection,
const char *pszOption,
int nValue);
132 ErrorCode
readSetting(
const char *section,
const char *option,
char *stringValue,
const char *defaultValue, uint32 nSize);
142 ErrorCode
readSetting(
const char *section,
const char *option,
int *nValue,
int defaultValue);
152 ErrorCode
readSetting(
const char *section,
const char *option,
bool *boolValue,
bool defaultValue);
ErrorCode readSetting(const char *section, const char *option, char *stringValue, const char *defaultValue, uint32 nSize)
CBofOptions(const char *pszOptionsFile=nullptr)
Loads specified .INI file which contains user options.
ErrorCode readSetting(const char *section, const char *option, int *nValue, int defaultValue)
ErrorCode writeSetting(const char *pszSection, const char *pszOption, int nValue)
ErrorCode readSetting(const char *section, const char *option, bool *boolValue, bool defaultValue)
ErrorCode writeSetting(const char *pszSection, const char *pszOption, const char *pszValue)
ErrorCode loadOptionFile(const char *pszFile)
Loads and builds Option list.