INI File Functions

:Associate with "INI File Functions" More...

Functions

LIBEXPORT void IniClose (INIHANDLE iniptr)
LIBEXPORT int IniDeleteField (INIHANDLE iniptr, const char *group, const char *field)
LIBEXPORT int IniDeleteGroup (INIHANDLE iniptr, const char *group)
LIBEXPORT int IniGetBuffer (INIHANDLE iniptr, MIUNICODE **buffer)
LIBEXPORT const FILEPATHIniGetFilePath (INIHANDLE inihandle)
LIBEXPORT int IniIsWritable (INIHANDLE iniptr)
LIBEXPORT ERRVALUE IniListAdd (const FILEPATH &filepath)
LIBEXPORT void IniListClear ()
LIBEXPORT ERRVALUE IniOpen (const FILEPATH &filepath, INIHANDLE *iniptr, UINT32 flags=INIFLAG_None)
LIBEXPORT int IniOpen (const char *basefilename, INIHANDLE *iniptr, UINT32 flags=INIFLAG_None)
int IniRead (INIHANDLE hdl, const char *group, const char *field, DPOINT3D &value, const DPOINT3D &dft)
int IniRead (INIHANDLE hdl, const char *group, const char *field, DPOINT3D &value)
int IniRead (INIHANDLE hdl, const char *group, const char *field, DPOINT2D &value, const DPOINT2D &dft)
int IniRead (INIHANDLE hdl, const char *group, const char *field, DPOINT2D &value)
int IniRead (INIHANDLE hdl, const char *group, const char *field, COLOR &value, const COLOR &dft)
int IniRead (INIHANDLE hdl, const char *group, const char *field, COLOR &value)
int IniRead (INIHANDLE hdl, const char *group, const char *field, MIUNICODE *str, int size)
int IniRead (INIHANDLE hdl, const char *group, const char *field, char *str, int size)
int IniRead (INIHANDLE hdl, const char *group, const char *field, double &value, double dft, double min, double max)
int IniRead (INIHANDLE hdl, const char *group, const char *field, double &value, double dft)
int IniRead (INIHANDLE hdl, const char *group, const char *field, double &value)
int IniRead (INIHANDLE hdl, const char *group, const char *field, float &value, float dft, float min, float max)
int IniRead (INIHANDLE hdl, const char *group, const char *field, float &value, float dft)
int IniRead (INIHANDLE hdl, const char *group, const char *field, float &value)
int IniRead (INIHANDLE hdl, const char *group, const char *field, int &value, int dft, int min, int max)
int IniRead (INIHANDLE hdl, const char *group, const char *field, int &value, int dft)
int IniRead (INIHANDLE hdl, const char *group, const char *field, int &value)
int IniRead (INIHANDLE hdl, const char *group, const char *field, UINT32 &value, UINT32 dft, UINT32 min, UINT32 max)
int IniRead (INIHANDLE hdl, const char *group, const char *field, UINT32 &value, UINT32 dft)
int IniRead (INIHANDLE hdl, const char *group, const char *field, UINT32 &value)
int IniRead (INIHANDLE hdl, const char *group, const char *field, INT32 &value, INT32 dft, INT32 min, INT32 max)
int IniRead (INIHANDLE hdl, const char *group, const char *field, INT32 &value, INT32 dft)
int IniRead (INIHANDLE hdl, const char *group, const char *field, INT32 &value)
int IniRead (INIHANDLE hdl, const char *group, const char *field, UINT16 &value, UINT16 dft, UINT16 min, UINT16 max)
int IniRead (INIHANDLE hdl, const char *group, const char *field, UINT16 &value, UINT16 dft)
int IniRead (INIHANDLE hdl, const char *group, const char *field, UINT16 &value)
int IniRead (INIHANDLE hdl, const char *group, const char *field, INT16 &value, INT16 dft, INT16 min, INT16 max)
int IniRead (INIHANDLE hdl, const char *group, const char *field, INT16 &value, INT16 dft)
int IniRead (INIHANDLE hdl, const char *group, const char *field, INT16 &value)
int IniRead (INIHANDLE hdl, const char *group, const char *field, UINT8 &value, UINT8 dft, UINT8 min, UINT8 max)
int IniRead (INIHANDLE hdl, const char *group, const char *field, UINT8 &value, UINT8 dft)
int IniRead (INIHANDLE hdl, const char *group, const char *field, UINT8 &value)
int IniRead (INIHANDLE hdl, const char *group, const char *field, INT8 &value, INT8 dft, INT8 min, INT8 max)
int IniRead (INIHANDLE hdl, const char *group, const char *field, INT8 &value, INT8 dft)
int IniRead (INIHANDLE hdl, const char *group, const char *field, INT8 &value)
int IniRead (INIHANDLE hdl, const char *group, const char *field, bool &value, bool dft)
int IniRead (INIHANDLE hdl, const char *group, const char *field, bool &value)
bool IniReadBoolean (INIHANDLE hdl, const char *group, const char *field, bool dft)
template<class _CT> int IniReadEnum (INIHANDLE hdl, const char *group, const char *field, _CT &value, _CT dft)
template<class _CT> int IniReadEnum (INIHANDLE hdl, const char *group, const char *field, _CT &value)
int IniReadStringMultiLine (INIHANDLE iniptr, const char *group, const char *field, MIUNICODE *&string)
int IniReadStringMultiLine (INIHANDLE iniptr, const char *group, const char *field, char *&string)
LIBEXPORT void IniSetAppName (const char *AppName)
LIBEXPORT int IniSetBuffer (INIHANDLE iniptr, MIUNICODE *buffer)
int IniWrite (INIHANDLE hdl, const char *group, const char *field, const DPOINT3D &value)
int IniWrite (INIHANDLE hdl, const char *group, const char *field, const DPOINT2D &value)
int IniWrite (INIHANDLE hdl, const char *group, const char *field, const COLOR &value)
int IniWrite (INIHANDLE hdl, const char *group, const char *field, const MIUNICODE *str)
int IniWrite (INIHANDLE hdl, const char *group, const char *field, const char *str)
int IniWrite (INIHANDLE hdl, const char *group, const char *field, double value)
int IniWrite (INIHANDLE hdl, const char *group, const char *field, UINT32 value)
int IniWrite (INIHANDLE hdl, const char *group, const char *field, INT32 value)
int IniWrite (INIHANDLE hdl, const char *group, const char *field, unsigned int value)
int IniWrite (INIHANDLE hdl, const char *group, const char *field, int value)
int IniWrite (INIHANDLE hdl, const char *group, const char *field, const bool &value)
LIBEXPORT int IniWriteBoolean (INIHANDLE iniptr, const char *group, const char *field, int value)
int IniWriteStringMultiLine (INIHANDLE iniptr, const char *group, const char *field, const MIUNICODE *string)
int IniWriteStringMultiLine (INIHANDLE iniptr, const char *group, const char *field, const char *string)

Detailed Description

:Associate with "INI File Functions"


Function Documentation

LIBEXPORT void IniClose INIHANDLE  iniptr  ) 
 

Close handle to opened .ini file.

This function should only be called when the .ini file is opened using IniOpen.

Parameters:
iniptr  Open INI file handle, NULL for default .ini file

LIBEXPORT int IniDeleteField INIHANDLE  iniptr,
const char *  group,
const char *  field
 

Delete a field entry in the .ini file.

Parameters:
iniptr  Open INI file handle, NULL for default .ini file
group  Group to find field in, uses GetAppName() if NULL
field  Field to delete

LIBEXPORT int IniDeleteGroup INIHANDLE  iniptr,
const char *  group
 

Delete a group from the .ini file.

Parameters:
iniptr  Open INI file handle, NULL for default .ini file
group  Group to delete

LIBEXPORT int IniGetBuffer INIHANDLE  iniptr,
MIUNICODE **  buffer
 

Get internal buffer into MIUNICODE string.

Returns:
Number of Unicode characters in output or error < 0.
Parameters:
iniptr  Open INI file handle, must pass INIFLAG_InternalOnly to IniOpen()
buffer  Buffer from Ini handle RETURNED, free using MmFree().

LIBEXPORT const FILEPATH& IniGetFilePath INIHANDLE  inihandle  ) 
 

Get path to actual Ini file.

Returns empty path if handle not opened or is attached to memory buffer.

LIBEXPORT int IniIsWritable INIHANDLE  iniptr  ) 
 

Determine if ini file is writable.

Returns:
1 if it is writable, 0 if it is not.
Parameters:
iniptr  Open INI file handle, NULL for default .ini file

LIBEXPORT ERRVALUE IniListAdd const FILEPATH filepath  ) 
 

Add file to preset list.

LIBEXPORT void IniListClear  ) 
 

Clear preset list.

LIBEXPORT ERRVALUE IniOpen const FILEPATH filepath,
INIHANDLE iniptr,
UINT32  flags = INIFLAG_None
 

Open INI file specified by FILEPATH.

Parameters:
filepath  File path to open
iniptr  INI handle returned

LIBEXPORT int IniOpen const char *  basefilename,
INIHANDLE iniptr,
UINT32  flags = INIFLAG_None
 

Open .ini file for modification.

This function does not keep the .ini file itself open, it reads the whole file into memory and processes it internally. If NULL is passed for 'basefilename', the INIFLAG_InternalOnly flag must be specified or an error will result. IniClose must be called to free the handle returned by this function. This function is not needed if the 'standard' .ini file is to be accessed, the other Ini... functions will manage this internally. Defined flags: INIFLAG_ReadOnly Do not allow writing through this handle. INIFLAG_InternalOnly Open Ini handle for use with memory buffer. See IniGetBuffer() and IniSetBuffer() for details. Default .ini file defines: INIFILE_Host tnthost.ini Host machine specific values, one per system.

Parameters:
basefilename  Name of .ini file to open (NULL for use with INIFLAG_InternalOnly)
iniptr  Handle to .ini file RETURNED
flags  Flags

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
DPOINT3D value,
const DPOINT3D dft
[inline]
 

Read 'DPOINT3D' value from INI file with default.

Definition at line 610 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
DPOINT3D value
[inline]
 

Read 'DPOINT3D' value from INI file.

Definition at line 607 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
DPOINT2D value,
const DPOINT2D dft
[inline]
 

Read 'DPOINT2D' value from INI file with default.

Definition at line 604 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
DPOINT2D value
[inline]
 

Read 'DPOINT2D' value from INI file.

Definition at line 601 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
COLOR value,
const COLOR dft
[inline]
 

Read 'COLOR' value from INI file with default.

Definition at line 598 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
COLOR value
[inline]
 

Read 'COLOR' value from INI file.

Definition at line 595 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
MIUNICODE str,
int  size
[inline]
 

Read 'MIUNICODE* string' value from INI file.

Definition at line 592 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
char *  str,
int  size
[inline]
 

Read 'char* string' value from INI file.

Definition at line 589 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
double &  value,
double  dft,
double  min,
double  max
[inline]
 

Read 'double' value from INI file with default and range.

Definition at line 586 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
double &  value,
double  dft
[inline]
 

Read 'double' value from INI file with default.

Definition at line 583 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
double &  value
[inline]
 

Read 'double' value from INI file.

Definition at line 580 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
float &  value,
float  dft,
float  min,
float  max
[inline]
 

Read 'float' value from INI file with default and range.

Definition at line 577 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
float &  value,
float  dft
[inline]
 

Read 'float' value from INI file with default.

Definition at line 574 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
float &  value
[inline]
 

Read 'float' value from INI file.

Definition at line 571 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
int &  value,
int  dft,
int  min,
int  max
[inline]
 

Read 'int' value from INI file with default and range.

Definition at line 566 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
int &  value,
int  dft
[inline]
 

Read 'int' value from INI file with default.

Definition at line 563 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
int &  value
[inline]
 

Read 'int' value from INI file.

Definition at line 560 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
UINT32 value,
UINT32  dft,
UINT32  min,
UINT32  max
[inline]
 

Read 'UINT32' value from INI file with default and range.

Definition at line 535 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
UINT32 value,
UINT32  dft
[inline]
 

Read 'UINT32' value from INI file with default.

Definition at line 532 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
UINT32 value
[inline]
 

Read 'UINT32' value from INI file.

Definition at line 529 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
INT32 value,
INT32  dft,
INT32  min,
INT32  max
[inline]
 

Read 'INT32' value from INI file with default and range.

Definition at line 526 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
INT32 value,
INT32  dft
[inline]
 

Read 'INT32' value from INI file with default.

Definition at line 523 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
INT32 value
[inline]
 

Read 'INT32' value from INI file.

Definition at line 520 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
UINT16 value,
UINT16  dft,
UINT16  min,
UINT16  max
[inline]
 

Read 'UINT16' value from INI file with default and range.

Definition at line 517 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
UINT16 value,
UINT16  dft
[inline]
 

Read 'UINT16' value from INI file with default.

Definition at line 514 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
UINT16 value
[inline]
 

Read 'UINT16' value from INI file.

Definition at line 511 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
INT16 value,
INT16  dft,
INT16  min,
INT16  max
[inline]
 

Read 'INT16' value from INI file with default and range.

Definition at line 508 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
INT16 value,
INT16  dft
[inline]
 

Read 'INT16' value from INI file with default.

Definition at line 505 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
INT16 value
[inline]
 

Read 'INT16' value from INI file.

Definition at line 502 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
UINT8 value,
UINT8  dft,
UINT8  min,
UINT8  max
[inline]
 

Read 'UINT8' value from INI file with default and range.

Definition at line 499 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
UINT8 value,
UINT8  dft
[inline]
 

Read 'UINT8' value from INI file with default.

Definition at line 496 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
UINT8 value
[inline]
 

Read 'UINT8' value from INI file.

Definition at line 493 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
INT8 value,
INT8  dft,
INT8  min,
INT8  max
[inline]
 

Read 'INT8' value from INI file with default and range check.

Definition at line 490 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
INT8 value,
INT8  dft
[inline]
 

Read 'INT8' value from INI file with default.

Definition at line 487 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
INT8 value
[inline]
 

Read 'INT8' value from INI file.

Definition at line 484 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
bool &  value,
bool  dft
[inline]
 

Read 'bool' value from INI file with default.

Definition at line 481 of file inidefns.h.

int IniRead INIHANDLE  hdl,
const char *  group,
const char *  field,
bool &  value
[inline]
 

Read 'bool' value from INI file.

Definition at line 478 of file inidefns.h.

bool IniReadBoolean INIHANDLE  hdl,
const char *  group,
const char *  field,
bool  dft
[inline]
 

Read general boolean value from INI file with default.

If the entry does not exist in the file or any error occurs the default will be returned.

Definition at line 614 of file inidefns.h.

template<class _CT>
int IniReadEnum INIHANDLE  hdl,
const char *  group,
const char *  field,
_CT &  value,
_CT  dft
[inline]
 

Read 'enum' from INI file with default.

Definition at line 633 of file inidefns.h.

template<class _CT>
int IniReadEnum INIHANDLE  hdl,
const char *  group,
const char *  field,
_CT &  value
[inline]
 

Read 'enum' from INI file.

Definition at line 618 of file inidefns.h.

int IniReadStringMultiLine INIHANDLE  iniptr,
const char *  group,
const char *  field,
MIUNICODE *&  string
[inline]
 

Read multi-line 'MIUNICODE*' string from INI file.

Parameters:
iniptr  Open INI file handle, NULL for default
group  Group to find field in, uses GetAppName() if NULL
field  Field that data is stored in
string  String to read into, allocated and returned

Definition at line 661 of file inidefns.h.

int IniReadStringMultiLine INIHANDLE  iniptr,
const char *  group,
const char *  field,
char *&  string
[inline]
 

Read multi-line 'char*' string from INI file.

Parameters:
iniptr  Open INI file handle, NULL for default
group  Group to find field in, uses GetAppName() if NULL
field  Field that data is stored in
string  String to read into, allocated and returned

Definition at line 651 of file inidefns.h.

LIBEXPORT void IniSetAppName const char *  AppName  ) 
 

Set application name for use when group == NULL and it overrides module name.

LIBEXPORT int IniSetBuffer INIHANDLE  iniptr,
MIUNICODE buffer
 

Set internal buffer from passed MIUNICODE string.

Parameters:
iniptr  Open INI file handle, must pass INIFLAG_InternalOnly to IniOpen()
buffer  Buffer to pass into Ini handle

int IniWrite INIHANDLE  hdl,
const char *  group,
const char *  field,
const DPOINT3D value
[inline]
 

Write 'DPOINT3D' value to INI file.

Definition at line 722 of file inidefns.h.

int IniWrite INIHANDLE  hdl,
const char *  group,
const char *  field,
const DPOINT2D value
[inline]
 

Write 'DPOINT2D' value to INI file.

Definition at line 719 of file inidefns.h.

int IniWrite INIHANDLE  hdl,