ScummVM API documentation
Bagel::CBofOptions Class Reference
Inheritance diagram for Bagel::CBofOptions:
Bagel::CBofObject Bagel::CBagel Bagel::CBofDebugOptions Bagel::SpaceBar::SpaceBarEngine

Public Member Functions

 CBofOptions (const char *pszOptionsFile=nullptr)
 Loads specified .INI file which contains user options. More...
 
virtual ~CBofOptions ()
 
ErrorCode commit ()
 
ErrorCode loadOptionFile (const char *pszFile)
 Loads and builds Option list. More...
 
const char * getFileName () const
 
ErrorCode writeSetting (const char *pszSection, const char *pszOption, const char *pszValue)
 
ErrorCode writeSetting (const char *pszSection, const char *pszOption, int nValue)
 
ErrorCode readSetting (const char *section, const char *option, char *stringValue, const char *defaultValue, uint32 nSize)
 
ErrorCode readSetting (const char *section, const char *option, int *nValue, int defaultValue)
 
ErrorCode readSetting (const char *section, const char *option, bool *boolValue, bool defaultValue)
 
ErrorCode load ()
 
void release ()
 

Protected Attributes

char _szFileName [MAX_FNAME]
 
COption_pOptionList
 
bool _bDirty
 

Additional Inherited Members

- Static Public Member Functions inherited from Bagel::CBofObject
static bool isValidObject (const CBofObject *pObject)
 

Constructor & Destructor Documentation

◆ CBofOptions()

Bagel::CBofOptions::CBofOptions ( const char *  pszOptionsFile = nullptr)

Loads specified .INI file which contains user options.

Constructor

Parameters
pszOptionsFileName of .INI settings file

◆ ~CBofOptions()

virtual Bagel::CBofOptions::~CBofOptions ( )
virtual

Destructor

Member Function Documentation

◆ commit()

ErrorCode Bagel::CBofOptions::commit ( )

Updates current option list file

Returns
Error return code

◆ loadOptionFile()

ErrorCode Bagel::CBofOptions::loadOptionFile ( const char *  pszFile)

Loads and builds Option list.

Loads specified .INI options file

Parameters
pszFileName of .INI file to load
Returns
Error return code

◆ writeSetting() [1/2]

ErrorCode Bagel::CBofOptions::writeSetting ( const char *  pszSection,
const char *  pszOption,
const char *  pszValue 
)

Adds or modifies 1 option in list

Parameters
pszSectionSection in .INI file
pszOptionOption to update
pszValueNew value
Returns
Error return code

◆ writeSetting() [2/2]

ErrorCode Bagel::CBofOptions::writeSetting ( const char *  pszSection,
const char *  pszOption,
int  nValue 
)

Adds or modifies 1 option in list

Parameters
pszSectionSection in .INI file
pszOptionOption to update
nValueNew value
Returns
Error return code

◆ readSetting() [1/3]

ErrorCode Bagel::CBofOptions::readSetting ( const char *  section,
const char *  option,
char *  stringValue,
const char *  defaultValue,
uint32  nSize 
)

Reads value for the specified option

Parameters
sectionSection in .INI file
optionOption to update
stringValueDestination buffer for read value
defaultValueDefault value if not exists
nSizeMax length of stringValue buffer
Returns
Error return code

◆ readSetting() [2/3]

ErrorCode Bagel::CBofOptions::readSetting ( const char *  section,
const char *  option,
int *  nValue,
int  defaultValue 
)

Reads value for the specified option

Parameters
sectionSection in .INI file
optionOption to update
nValuePointer to write value to
defaultValueDefault value if not exists
Returns
Error return code

◆ readSetting() [3/3]

ErrorCode Bagel::CBofOptions::readSetting ( const char *  section,
const char *  option,
bool *  boolValue,
bool  defaultValue 
)

Reads value for the specified option

Parameters
sectionSection in .INI file
optionOption to update
boolValuePointer to write value to
defaultValueDefault value if not exists
Returns
Error return code

◆ load()

ErrorCode Bagel::CBofOptions::load ( )

Loads current .INI options file

Returns
Error return code

◆ release()

void Bagel::CBofOptions::release ( )

Updates and Releases current option list


The documentation for this class was generated from the following file: