DDS  ver. 3.4
Public Types | Public Member Functions | List of all members
MiscCommon::CFindCfgFile< _T > Class Template Reference

This class helps to find a cfg location with the best match from the given order. More...

#include <FindCfgFile.h>

Public Types

typedef _T container_value
 
typedef std::vector< _Tcontainer_type
 

Public Member Functions

CFindCfgFileSetOrder (const container_value &_Path)
 
CFindCfgFileoperator() (const container_value &_Path)
 
void GetCfg (_T *_RetVal)
 
void DumpOrder (std::ostream *_stream, const container_value &_Seporator)
 

Detailed Description

template<class _T>
class MiscCommon::CFindCfgFile< _T >

This class helps to find a cfg location with the best match from the given order.

Note
Example: The example shows how to look for the basch cfg. file in the following order: "/etc/rtt", "/etc/bashrc", "testtesttest", "$HOME/.bashrc", "/test/test/bashrc" The first found cfg file will be returned by GetCfg method. All environment variables in the paths will be extended.
int main()
{
CFindCfgFile<string> cfg;
cfg.SetOrder
("/etc/rtt")
("/etc/bashrc")
("testtesttest")
("$HOME/.bashrc")
("/test/test/bashrc");
string val;
cfg.GetCfg( &val );
}

Member Typedef Documentation

◆ container_type

template<class _T >
typedef std::vector<_T> MiscCommon::CFindCfgFile< _T >::container_type

◆ container_value

template<class _T >
typedef _T MiscCommon::CFindCfgFile< _T >::container_value

Member Function Documentation

◆ DumpOrder()

template<class _T >
void MiscCommon::CFindCfgFile< _T >::DumpOrder ( std::ostream *  _stream,
const container_value _Seporator 
)
inline

◆ GetCfg()

template<class _T >
void MiscCommon::CFindCfgFile< _T >::GetCfg ( _T _RetVal)
inline

◆ operator()()

template<class _T >
CFindCfgFile& MiscCommon::CFindCfgFile< _T >::operator() ( const container_value _Path)
inline

◆ SetOrder()

template<class _T >
CFindCfgFile& MiscCommon::CFindCfgFile< _T >::SetOrder ( const container_value _Path)
inline

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