INI File Functions


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 ERRVALUE IniFlush (INIHANDLE iniptr)
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, 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, unsigned long &value, unsigned long dft, unsigned long min, unsigned long max)
int IniRead (INIHANDLE hdl, const char *group, const char *field, unsigned long &value, unsigned long dft)
int IniRead (INIHANDLE hdl, const char *group, const char *field, unsigned long &value)
int IniRead (INIHANDLE hdl, const char *group, const char *field, long &value, long dft, long min, long max)
int IniRead (INIHANDLE hdl, const char *group, const char *field, long &value, long dft)
int IniRead (INIHANDLE hdl, const char *group, const char *field, long &value)
int IniRead (INIHANDLE hdl, const char *group, const char *field, unsigned int &value, unsigned int dft, unsigned int min, unsigned int max)
int IniRead (INIHANDLE hdl, const char *group, const char *field, unsigned int &value, unsigned int dft)
int IniRead (INIHANDLE hdl, const char *group, const char *field, unsigned int &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, 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 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, unsigned long value)
int IniWrite (INIHANDLE hdl, const char *group, const char *field, long 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)

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 ERRVALUE IniFlush ( INIHANDLE  iniptr  ) 

Flush the ini buffer to the file. Only useful if INIFLAG_NoFlushOnWrite was specified in IniOpen().

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

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,
MIUNICODE str,
int  size 
) [inline]

Read 'MIUNICODE* string' value from INI file.

Definition at line 524 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 521 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 518 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 515 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 512 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 509 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 506 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 503 of file inidefns.h.

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

Read 'unsigned long' value from INI file with default and range.

Definition at line 488 of file inidefns.h.

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

Read 'unsigned long' value from INI file with default.

Definition at line 485 of file inidefns.h.

int IniRead ( INIHANDLE  hdl,
const char *  group,
const char *  field,
unsigned long &  value 
) [inline]

Read 'unsigned long' value from INI file.

Definition at line 482 of file inidefns.h.

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

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

Definition at line 479 of file inidefns.h.

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

Read 'long' value from INI file with default.

Definition at line 476 of file inidefns.h.

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

Read 'long' value from INI file.

Definition at line 473 of file inidefns.h.

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

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

Definition at line 468 of file inidefns.h.

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

Read 'unsigned int' value from INI file with default.

Definition at line 465 of file inidefns.h.

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

Read 'unsigned int' value from INI file.

Definition at line 462 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 459 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 456 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 453 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 450 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 447 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 444 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 441 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 438 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 435 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 432 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 429 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 426 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 423 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 420 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 417 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 414 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 411 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 528 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 547 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 532 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 575 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 565 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 MIUNICODE str 
) [inline]

Write 'MIUNICODE* string' value to INI file.

Do NOT use this function to store multi-line strings (containing newlines). Use IniWriteStringMultiLine.

Definition at line 619 of file inidefns.h.

int IniWrite ( INIHANDLE  hdl,
const char *  group,
const char *  field,
const char *  str 
) [inline]

Write 'char* string' value to INI file.

Do NOT use this function to store multi-line strings (containing newlines). Use IniWriteStringMultiLine.

Definition at line 615 of file inidefns.h.

int IniWrite ( INIHANDLE  hdl,
const char *  group,
const char *  field,
double  value 
) [inline]

Write floating-point value to INI file.

Definition at line 611 of file inidefns.h.

int IniWrite ( INIHANDLE  hdl,
const char *  group,
const char *  field,
unsigned long  value 
) [inline]

Write 'unsigned long' value to INI file.

Definition at line 599 of file inidefns.h.

int IniWrite ( INIHANDLE  hdl,
const char *  group,
const char *  field,
long  value 
) [inline]

Write 'long' value to INI file.

Definition at line 596 of file inidefns.h.

int IniWrite ( INIHANDLE  hdl,
const char *  group,
const char *  field,
unsigned int  value 
) [inline]

Write unsigned integer or enum value to INI file.

Definition at line 591 of file inidefns.h.

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

Write signed integer or enum value to INI file.

Definition at line 588 of file inidefns.h.