INI_AUTO_ENUM< _DT > Class Template Reference

INI_AUTO_ENUM is a class designed to automatically handle reading and writing of enum data from an INI file and ensure that IniReadEnum \ IniWrite pairs function together correctly. More...

#include <mi32/iniauto.h>

List of all members.

Public Member Functions

 INI_AUTO_ENUM (const _DT &defaultdata, const char *field, const char *group=NULL, bool copyfield=false, bool copygroup=false)
 ~INI_AUTO_ENUM ()
 operator const _DT & () const
const _DT & operator= (const _DT &dt)
void Set (const _DT &dt, bool write=true)
void Write (INIHANDLE inihandle=NULL) const

Detailed Description

template<class _DT>
class INI_AUTO_ENUM< _DT >

INI_AUTO_ENUM is a class designed to automatically handle reading and writing of enum data from an INI file and ensure that IniReadEnum \ IniWrite pairs function together correctly.

The constructor calls IniReadEnum and the assignment operator calls IniWrite. The Write method allows the data to be written to the INI file at times other than assignment.

Example: enum COLORTYPE {...}; INI_AUTO_ENUM<COLORTYPE> m_ColorType; In container constructor's initializer list: m_ColorType(COLORTYPE_Default),


Constructor & Destructor Documentation

template<class _DT >
INI_AUTO_ENUM< _DT >::INI_AUTO_ENUM ( const _DT &  defaultdata,
const char *  field,
const char *  group = NULL,
bool  copyfield = false,
bool  copygroup = false 
) [inline]
Parameters:
defaultdata Default value
field Field that the data is to be stored under
group Group to locate field in, uses GetAppName() if NULL
copyfield Keep internal copy
copygroup Keep internal copy
template<class _DT >
INI_AUTO_ENUM< _DT >::~INI_AUTO_ENUM (  )  [inline]

Member Function Documentation

template<class _DT >
INI_AUTO_ENUM< _DT >::operator const _DT & (  )  const [inline]
template<class _DT >
const _DT& INI_AUTO_ENUM< _DT >::operator= ( const _DT &  dt  )  [inline]
template<class _DT >
void INI_AUTO_ENUM< _DT >::Set ( const _DT &  dt,
bool  write = true 
) [inline]

Alternative to assignment - allows setting of data without writing to file.

template<class _DT >
void INI_AUTO_ENUM< _DT >::Write ( INIHANDLE  inihandle = NULL  )  const [inline]

Force write to file.


The documentation for this class was generated from the following file:

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