Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

dtool/src/dconfig/configTable.h

Go to the documentation of this file.
00001 // Filename: configTable.h
00002 // Created by:  drose (15May00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #ifndef CONFIGTABLE_H
00020 #define CONFIGTABLE_H
00021 
00022 #include <dtoolbase.h>
00023 
00024 #include "config_setup.h"
00025 #include "config_dconfig.h"
00026 #include "symbolEnt.h"
00027 
00028 #include <vector>
00029 #include <map>
00030 
00031 namespace Config {
00032 
00033 class EXPCL_DTOOLCONFIG ConfigTable {
00034    private:
00035       static ConfigTable* _instance;
00036    public:
00037       typedef SymbolEnt           SymEnt;
00038       typedef vector_SymbolEnt    Symbol;
00039    private:
00040       typedef std::map<ConfigString, Symbol>      SymbolTable;
00041       typedef std::map<ConfigString, SymbolTable> TableMap;
00042       SymbolTable unqualified;
00043       TableMap qualified;
00044       bool _initializing;
00045       bool configdbg;
00046       bool readargs;
00047       bool readenvs;
00048       ConfigString pathsep;
00049       ConfigString filesep;
00050       ConfigString configname;
00051       ConfigString configsuffix;
00052       ConfigString configargs;
00053       ConfigString configpath;
00054       ConfigString configcmt;
00055       ConfigString argsuffix;
00056       ConfigString commandstub;
00057 
00058       static void CropString(ConfigString& S);
00059       void DeComment(ConfigString& S);
00060       bool IsComment(const ConfigString&);
00061       static void UpCase(ConfigString&);
00062       ConfigString NextWord(const ConfigString& S);
00063       ConfigString PopNextWord(ConfigString& S);
00064       void ParseConfigFile(istream&, const ConfigString&);
00065       void ReadConfigFile(void);
00066       void ParseCommandEnv(ConfigString&, const ConfigString&);
00067       void ParseArgs(void);
00068       INLINE void ConfigDbgDefault(void);
00069       INLINE void ReadArgsDefault(void);
00070       INLINE void ReadEnvsDefault(void);
00071       INLINE void PathSepDefault(void);
00072       INLINE void FileSepDefault(void);
00073       INLINE void ConfigNameDefault(void);
00074       INLINE void ConfigSuffixDefault(void);
00075       INLINE void ConfigArgsDefault(void);
00076       INLINE void ConfigPathDefault(void);
00077       INLINE void ConfigCmtDefault(void);
00078       INLINE void ArgSuffixDefault(void);
00079       INLINE void CommandStubDefault(void);
00080       void MicroConfig(void);
00081       void GetData(void);
00082    protected:
00083       ConfigTable(void) : _initializing(true) {}
00084    public:
00085       static ConfigTable* Instance(void);
00086       bool AmInitializing(void);
00087       static bool TrueOrFalse(const ConfigString& in, bool def = false);
00088       bool Defined(const ConfigString& sym, const ConfigString qual="");
00089       SymEnt Get(const ConfigString& sym, const ConfigString qual = "");
00090       const Symbol& GetSym(const ConfigString& sym,
00091                            const ConfigString qual = "");
00092       INLINE ConfigString GetConfigPath(void) const;
00093       INLINE bool IsConfigDbg(void) { return configdbg; };
00094 };
00095 
00096 #include "configTable.I"
00097 
00098 } // close Config namespace
00099 
00100 #endif

Generated on Thu May 1 22:12:57 2003 for DTool by doxygen1.3