NIREP

C:/Programs/source/NIREP/DisplayDescription/VariableList/VariableList.h

00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00015 // to do
00016 // -> this
00017 // -> start plugins
00018 // -> look at how to do the plugins runtime
00019 #pragma once
00020 
00021 
00022 /* +-----------+
00023    | Libraries |
00024    +-----------+ */
00025 #include <map>
00026 #include <string>
00027 #include <vector>
00028 
00029 #include <iostream>
00030 #include <fstream>
00031 
00032 
00033 #include  "wx/wxprec.h"
00034 
00035 #ifndef WX_PRECOMP
00036 #include  "wx/wx.h"
00037 #endif
00038 
00039 
00040 /* +--------+
00041          | Macros |
00042          +--------+ */
00043 #define VARIABLELIST 3
00044 
00045 
00046 /* +---------+
00047    | Classes |
00048    +---------+ */
00063 class VariableList {
00064 
00065   public:
00066   /* +----------------+
00067          | Public Methods |
00068          +----------------+ */
00069           
00072     VariableList(){};
00073         VariableList(const std::string& fileName);
00074 
00077   ~VariableList(){};
00078 
00085         int Read(const std::string& fileName);
00086 
00087         
00095         void SetVariable(std::string key, std::string value) { this->vList[key] = value; };
00096 
00097         
00103         std::string GetVariable(std::string key){
00104                 return (this->inMap(this->vList,key)?this->vList[key]:"$"); 
00105         };
00106 
00115         std::string UpdateString(const std::string& source);
00116 
00117   std::map<std::string,std::string> * GetVariableList(){return &vList;};
00118 
00119   void ClearList(){vList.clear();};
00120 
00121   private:
00122           
00123   /* +-----------------+
00124          | Private Methods |
00125          +-----------------+ */
00126 
00136         template <typename S, typename T>
00137         bool inMap(std::map<S, T> map, S key);
00138 
00139   std::map<std::string,std::string> vList;
00140 
00141         
00142   /* +-------------------+
00143          | Private Parameters |
00144          +-------------------+ */
00145         
00146 };
 All Classes Functions Variables Typedefs Enumerations Enumerator