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 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, 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, 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 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, 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)

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 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,
DPOINT3D value,
const DPOINT3D dft 
) [inline]

Read 'DPOINT3D' value from INI file with default.

Definition at line 629 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 626 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 623 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 620 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 617 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 614 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 611 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 608 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 605 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 602 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 599 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 596 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 593 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 590 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 575 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 572 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 569 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 566 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 563 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 560 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 555 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 552 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 549 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 546 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 543 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 540 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 537 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 534 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 531 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 528 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 525 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 522 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 519 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 516 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 513 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 510 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 507 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 504 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 501 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 498 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 633 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 652 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 637 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 680 of file inidefns.h.

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