Mass++ Common Libraries v2.7.5
 All Classes Namespaces Files Functions Variables Enumerations Macros
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
kome::core::IniFile::IniFileManager Class Reference

IniFile object management class. More...

#include <IniFile.h>

Public Member Functions

 IniFileManager ()
 constructor
 
virtual ~IniFileManager ()
 destructor
 
void setFile (IniFile *file)
 sets ini file information object to map More...
 
IniFilegetFile (const char *path)
 gets ini file information object More...
 
void save ()
 save all ini files
 

Static Public Member Functions

static IniFileManagergetInstance ()
 gets ini file manager object (This is the only object.) More...
 

Protected Attributes

std::map< std::string, IniFile * > m_fileMap
 

Detailed Description

IniFile object management class.

Definition at line 274 of file IniFile.h.

Member Function Documentation

IniFile * kome::core::IniFile::IniFileManager::getFile ( const char *  path)

gets ini file information object

Parameters
[in]pathini file path
Returns
ini file information object

Definition at line 650 of file IniFile.cpp.

650  {
651  // absolute path
652  std::string p = absolutepath( path );
653 
654  // search map
655  if( m_fileMap.find( p ) == m_fileMap.end() ) {
656  return NULL;
657  }
658 
659  return m_fileMap[ p ];
660 }
std::map< std::string, IniFile * > m_fileMap
Definition: IniFile.h:290
#define NULL
Definition: CoreMacros.h:18
std::string absolutepath(const char *path)
get absolute path

Here is the call graph for this function:

static IniFileManager & kome::core::IniFile::IniFileManager::getInstance ( )
static

gets ini file manager object (This is the only object.)

Returns
ini file manager object

Definition at line 673 of file IniFile.cpp.

673  {
674  // create object
675  static IniFileManager mgr;
676 
677  return mgr;
678 }
void kome::core::IniFile::IniFileManager::setFile ( IniFile file)

sets ini file information object to map

Parameters
[in]fileini file information object

Definition at line 631 of file IniFile.cpp.

631  {
632  // check parameter
633  if( file == NULL ) {
634  return;
635  }
636 
637  // absolutepath
638  std::string path = absolutepath( file->getFilePath() );
639 
640  // search map
641  if( m_fileMap.find( path ) != m_fileMap.end() ) {
642  delete m_fileMap[ path ];
643  }
644 
645  // set to map
646  m_fileMap[ path ] = file;
647 }
std::map< std::string, IniFile * > m_fileMap
Definition: IniFile.h:290
#define NULL
Definition: CoreMacros.h:18
std::string absolutepath(const char *path)
get absolute path
const char * getFilePath()
gets file path
Definition: IniFile.cpp:59

Here is the call graph for this function:

Member Data Documentation

std::map< std::string, IniFile* > kome::core::IniFile::IniFileManager::m_fileMap
protected

file map (path -> ini file data)

Definition at line 290 of file IniFile.h.


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