cconfig.h

00001 //==========================================================================
00002 //  CCONFIG.H - part of
00003 //
00004 //                     OMNeT++/OMNEST
00005 //            Discrete System Simulation in C++
00006 //
00007 //
00008 //  Declaration of the following classes:
00009 //    cConfiguration
00010 //
00011 //==========================================================================
00012 
00013 /*--------------------------------------------------------------*
00014   Copyright (C) 1992-2005 Andras Varga
00015 
00016   This file is distributed WITHOUT ANY WARRANTY. See the file
00017   `license' for details on this and other legal matters.
00018 *--------------------------------------------------------------*/
00019 
00020 #ifndef __CCONFIG_H
00021 #define __CCONFIG_H
00022 
00023 #include <vector>
00024 #include "defs.h"
00025 #include "opp_string.h"
00026 #include "cpolymorphic.h"
00027 
00028 
00059 class ENVIR_API cConfiguration : public cPolymorphic
00060 {
00061   public:
00065     virtual ~cConfiguration() {}
00066 
00073     virtual void initializeFrom(cConfiguration *conf) = 0;
00074 
00080     virtual int getNumSections() = 0;
00081 
00085     virtual const char *getSectionName(int k) = 0;
00087 
00094     virtual bool exists(const char *section, const char *key) = 0;
00095 
00099     virtual bool exists2(const char *section1, const char *section2, const char *key) = 0;
00100 
00105     virtual bool notFound() = 0;
00107 
00110 
00112     virtual bool getAsBool(const char *section, const char *key, bool defaultvalue=false) = 0;
00113 
00115     virtual long getAsInt(const char *section, const char *key, long defaultvalue=0) = 0;
00116 
00118     virtual double getAsDouble(const char *section, const char *key, double defaultvalue=0.0) = 0;
00119 
00121     virtual double getAsTime(const char *sect, const char *key, double defaultvalue=0.0) = 0;
00122 
00124     virtual const char *getAsString(const char *section, const char *key, const char *defaultvalue="") = 0; // quotes stripped (if any)
00125 
00131     virtual std::string getAsFilename(const char *section, const char *key, const char *defaultvalue="") = 0;
00132 
00140     virtual std::string getAsFilenames(const char *section, const char *key, const char *defaultvalue="") = 0;
00141 
00143     virtual const char *getAsCustom(const char *section, const char *key, const char *defaultvalue=NULL) = 0; // with quotes (if any)
00144 
00154     virtual const char *getBaseDirectoryFor(const char *section, const char *key) = 0;
00155 
00160     virtual std::string getLocation(const char *section, const char *key) = 0;
00162 
00166     virtual bool getAsBool2(const char *section1, const char *section2, const char *key, bool defaultvalue=false) = 0;
00167 
00169     virtual long getAsInt2(const char *section1, const char *section2, const char *key, long defaultvalue=0) = 0;
00170 
00172     virtual double getAsDouble2(const char *section1, const char *section2, const char *key, double defaultvalue=0.0) = 0;
00173 
00175     virtual double getAsTime2(const char *section1, const char *section2, const char *key, double defaultvalue=0.0) = 0;
00176 
00178     virtual const char *getAsString2(const char *section1, const char *section2, const char *key, const char *defaultvalue="") = 0;
00179 
00184     virtual std::string getAsFilename2(const char *section1, const char *section2, const char *key, const char *defaultvalue="") = 0;
00185 
00190     virtual std::string getAsFilenames2(const char *section1, const char *section2, const char *key, const char *defaultvalue="") = 0;
00191 
00193     virtual const char *getAsCustom2(const char *section1, const char *section2, const char *key, const char *defaultvalue="") = 0;
00194 
00199     virtual const char *getBaseDirectoryFor(const char *section1, const char *section2, const char *key) = 0;
00200 
00205     virtual std::string getLocation(const char *section1, const char *section2, const char *key) = 0;
00207 
00231     virtual std::vector<opp_string> getEntriesWithPrefix(const char *section, const char *keypart1, const char *keypart2) = 0;
00232 
00236     virtual std::vector<opp_string> getEntriesWithPrefix(const char *section1, const char *section2, const char *keypart1, const char *keypart2) = 0;
00238 
00243     virtual const char *fileName() const = 0;
00244 };
00245 
00246 #endif
00247 
00248 

Generated on Sat Oct 21 17:47:55 2006 for OMNeT++/OMNEST Simulation Library by  doxygen 1.4.6