Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

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 
00111     virtual bool getAsBool(const char *section, const char *key, bool defaultvalue=false) = 0;
00113     virtual long getAsInt(const char *section, const char *key, long defaultvalue=0) = 0;
00115     virtual double getAsDouble(const char *section, const char *key, double defaultvalue=0.0) = 0;
00117     virtual double getAsTime(const char *sect, const char *key, double defaultvalue=0.0) = 0;
00119     virtual const char *getAsString(const char *section, const char *key, const char *defaultvalue="") = 0; // quotes stripped (if any)
00126     virtual std::string getAsFilenames(const char *section, const char *key, const char *defaultvalue="") = 0;
00128     virtual const char *getAsCustom(const char *section, const char *key, const char *defaultvalue=NULL) = 0; // with quotes (if any)
00138     virtual const char *getBaseDirectoryFor(const char *section, const char *key) = 0;
00143     virtual std::string getLocation(const char *section, const char *key) = 0;
00145 
00149     virtual bool getAsBool2(const char *section1, const char *section2, const char *key, bool defaultvalue=false) = 0;
00151     virtual long getAsInt2(const char *section1, const char *section2, const char *key, long defaultvalue=0) = 0;
00153     virtual double getAsDouble2(const char *section1, const char *section2, const char *key, double defaultvalue=0.0) = 0;
00155     virtual double getAsTime2(const char *section1, const char *section2, const char *key, double defaultvalue=0.0) = 0;
00157     virtual const char *getAsString2(const char *section1, const char *section2, const char *key, const char *defaultvalue="") = 0;
00162     virtual std::string getAsFilenames2(const char *section1, const char *section2, const char *key, const char *defaultvalue="") = 0;
00164     virtual const char *getAsCustom2(const char *section1, const char *section2, const char *key, const char *defaultvalue="") = 0;
00169     virtual const char *getBaseDirectoryFor(const char *section1, const char *section2, const char *key) = 0;
00174     virtual std::string getLocation(const char *section1, const char *section2, const char *key) = 0;
00176 
00200     virtual std::vector<opp_string> getEntriesWithPrefix(const char *section, const char *keypart1, const char *keypart2) = 0;
00201 
00205     virtual std::vector<opp_string> getEntriesWithPrefix(const char *section1, const char *section2, const char *keypart1, const char *keypart2) = 0;
00207 
00212     virtual const char *fileName() const = 0;
00213 };
00214 
00215 #endif
00216 
00217 

Generated on Thu Jan 12 16:01:40 2006 for OMNeT++/OMNEST Simulation Library by  doxygen 1.4.1