// // File : InifileChain.hh // // Purpose: Declaration of the class InifileChain // // $Id: InifileChain.hh 8758 2010-09-27 12:16:24Z mathes $ // /** @file InifileChain.hh * Declaration of the class InifileChain. * @author H.-J. Mathes, FzK */ #ifndef _FdUtil_InifileChain_hh_ #define _FdUtil_InifileChain_hh_ #include #include #ifndef NO_VERSION # include #endif // NO_VERSION #include namespace FdUtil { /** This class implements a chain of Inifiles. * * The interface of Inifile is partly re-implemented. A chained Inifile has the * behaviour of several Inifiles where a group might be searched for in * different files. The search order is the order in which the files are * registered */ class InifileChain : public FdUtil::Inifile { public: /** Constructor for the class InifileChain. */ InifileChain(const char *); //InifileChain(const char **); //InifileChain(const char *,...); /** Constructor of the class InifileChain from Inifile. */ InifileChain(Inifile&); /** Destructor of the class InifileChain. */ virtual ~InifileChain(); /** Add a new filename to the list of ini-files. * * Before adding the filename the following things are checked: * @li the filename mustn't be empty * @li the filename mustn't exist already in the list * @li the file must exist * * @return kFAIL if any error occurs, kSUCCESS else. */ virtual int AddInifile(const char *); /** Specify the group ['group'] from where to read next. * * The corresponding method of the class Inifile is overwritten. The * list of files is opened subsequently and parsed for the specified * group until the group is found or the end of the list is reached. */ int SpecifyGroup(const char *group); protected: /** */ std::list fFiles; private: // these ones are not allowed InifileChain(); InifileChain(const InifileChain&); InifileChain& operator=(const InifileChain&); }; } // namespace FdUtil #endif // _FdUtil_InifileChain_hh_