INI File Functions

Function prototypes. 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, 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)

Detailed Description

Function prototypes.


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.

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

Read 'char* string' value from INI file.

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.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
int IniRead ( INIHANDLE  hdl,
const char *  group,
const char *  field,
double &  value,
double  dft 
) [inline]

Read 'double' value from INI file with default.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
int IniRead ( INIHANDLE  hdl,
const char *  group,
const char *  field,
double &  value 
) [inline]

Read 'double' value from INI file.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
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.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
int IniRead ( INIHANDLE  hdl,
const char *  group,
const char *  field,
float &  value,
float  dft 
) [inline]

Read 'float' value from INI file with default.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
int IniRead ( INIHANDLE  hdl,
const char *  group,
const char *  field,
float &  value 
) [inline]

Read 'float' value from INI file.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
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.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
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.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
int IniRead ( INIHANDLE  hdl,
const char *  group,
const char *  field,
unsigned long &  value 
) [inline]

Read 'unsigned long' value from INI file.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
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.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
int IniRead ( INIHANDLE  hdl,
const char *  group,
const char *  field,
long &  value,
long  dft 
) [inline]

Read 'long' value from INI file with default.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
int IniRead ( INIHANDLE  hdl,
const char *  group,
const char *  field,
long &  value 
) [inline]

Read 'long' value from INI file.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
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.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
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.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
int IniRead ( INIHANDLE  hdl,
const char *  group,
const char *  field,
unsigned int &  value 
) [inline]

Read 'unsigned int' value from INI file.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
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.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
int IniRead ( INIHANDLE  hdl,
const char *  group,
const char *  field,
int &  value,
int  dft 
) [inline]

Read 'int' value from INI file with default.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
int IniRead ( INIHANDLE  hdl,
const char *  group,
const char *  field,
int &  value 
) [inline]

Read 'int' value from INI file.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
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.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
int IniRead ( INIHANDLE  hdl,
const char *  group,
const char *  field,
UINT16 value,
UINT16  dft 
) [inline]

Read 'UINT16' value from INI file with default.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
int IniRead ( INIHANDLE  hdl,
const char *  group,
const char *  field,
UINT16 value 
) [inline]

Read 'UINT16' value from INI file.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
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.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
int IniRead ( INIHANDLE  hdl,
const char *  group,
const char *  field,
INT16 value,
INT16  dft 
) [inline]

Read 'INT16' value from INI file with default.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
int IniRead ( INIHANDLE  hdl,
const char *  group,
const char *  field,
INT16 value 
) [inline]

Read 'INT16' value from INI file.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
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.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
int IniRead ( INIHANDLE  hdl,
const char *  group,
const char *  field,
UINT8 value,
UINT8  dft 
) [inline]

Read 'UINT8' value from INI file with default.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
int IniRead ( INIHANDLE  hdl,
const char *  group,
const char *  field,
UINT8 value 
) [inline]

Read 'UINT8' value from INI file.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
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.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
int IniRead ( INIHANDLE  hdl,
const char *  group,
const char *  field,
INT8 value,
INT8  dft 
) [inline]

Read 'INT8' value from INI file with default.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
int IniRead ( INIHANDLE  hdl,
const char *  group,
const char *  field,
INT8 value 
) [inline]

Read 'INT8' value from INI file.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
int IniRead ( INIHANDLE  hdl,
const char *  group,
const char *  field,
bool &  value,
bool  dft 
) [inline]

Read 'bool' value from INI file with default.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
int IniRead ( INIHANDLE  hdl,
const char *  group,
const char *  field,
bool &  value 
) [inline]

Read 'bool' value from INI file.

Returns:
TRUE if item read, FALSE if not, < 0 if error.
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.

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.

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

Read 'enum' from INI file.

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
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
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.

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.

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

Write floating-point value to INI file.

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

Write 'unsigned long' value to INI file.

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

Write 'long' value to INI file.

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

Write unsigned integer or enum value to INI file.

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

Write signed integer or enum value to INI file.

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

Write 'bool' value to INI file.

LIBEXPORT int IniWriteBoolean ( INIHANDLE  iniptr,
const char *  group,
const char *  field,
int  value 
)

Write single boolean value to .ini file.

Returns:
Error if < 0 or number of bytes written.

This is useful for writing constant values (TRUE or FALSE).

Parameters:
iniptr Open INI file handle NULL for default
group Group to locate field in, uses GetAppName() if NULL
field Field that the data is to be stored under
value Value to write (NOT A POINTER)
int IniWriteStringMultiLine ( INIHANDLE  iniptr,
const char *  group,
const char *  field,
const MIUNICODE string 
) [inline]

Write multi-line 'MIUNICODE*' string to Ini file.

Parameters:
iniptr Open INI file handle NULL for default
group Group to locate field in, uses GetAppName() if NULL
field Field that the data is to be stored under
string String to write
int IniWriteStringMultiLine ( INIHANDLE  iniptr,
const char *  group,
const char *  field,
const char *  string 
) [inline]

Write multi-line 'char*' string to Ini file.

Parameters:
iniptr Open INI file handle NULL for default
group Group to locate field in, uses GetAppName() if NULL
field Field that the data is to be stored under
string String to write

Generated on Sun Oct 7 21:33:02 2012 for TNTsdk 2012 by  doxygen 1.6.1