LoadOrSaveConfig(
     int:iOperation,
     LPDOPUSPLUGINCONFIGDATA:lpCfgData
)
→ BOOL

Arguments

iOperation

[in] Operation to perform. Valid values are:

OPUSCFG_LOADLoad configuration data
OPUSCFG_SAVESave configuration data

lpCfgData

[in,out] Configuration data to load or save

Return value

Returns TRUE if the operation was successful, or FALSE on failure.

Description

The LoadOrSaveConfig function lets you load or save simple configuration data in XML format without needing to perform the XML parsing yourself.

The OPUSPLUGINCONFIGDATA structure contains the name of the configuration file to load or save, and an array of DOPUSPLUGINCONFIGITEM structures which define the actual data. The fields in the OPUSPLUGINCONFIGDATA structure are:

The DOPUSPLUGINCONFIGITEM array defines the configuration data to load or save. Each member of the array specifies one item of data. Each item has a name, a type, as well as the actual data. The fields of this structure are:

DPCITYPE_BoolBoolean value (TRUE or FALSE)
DPCITYPE_IntSigned 32-bit integer value
DPCITYPE_DWORDUnsigned 32-bit integer value
DPCITYPE_LPSTRANSI string (null-terminated)
DPCITYPE_LPWSTRUnicode string (null-terminated)
DPCITYPE_BinaryArbitrary binary data
DPCITYPE_LOGFONTLOGFONT structure
DPCITYPE_ChildNested child structure (no data)

Note that several of the data types have special rules which apply to them:

See the supplied RAR sample VFS plugin for an example of how to use the LoadOrSaveConfig function.