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

ConfigBuffer.h

00001                   /*   ConfigBuffer.h   */
00002 
00003 #ifndef CONFIG_BUFFER
00004 #define CONFIG_BUFFER
00005 
00006 #include <string>
00007 #include <vector>
00008 #include <map>
00009 #include <fstream>
00010 #include <iostream>
00011 
00012 
00017 namespace LcgConfigBuffer{
00018 
00019 using namespace std;
00020 
00021 enum REsult { FAILURE , SUCCESS}; 
00022 
00023 
00028 class ConfigBuffer {
00029 
00030  private: 
00031    
00032   map<string,string>  _MBuffer;
00033  
00034  public:
00035   
00036   ConfigBuffer();
00037   ConfigBuffer(const string& filename);
00038   ~ConfigBuffer();
00039 
00043   void show_map();
00044 
00048   std::vector<std::string> list_attributes();
00049 
00053   string get_attribute_value (const string& Attribute);
00054 
00055   /* 
00056    * Sets the value of a given attribute
00057    */
00058   REsult set_attribute_value(const string& Attribute, const string& Value);
00059 
00063   REsult create_new_attribute(const string& Attribute);
00064 
00065   /*
00066    * Populates a map from a config file
00067    */
00068   int populate_from_config(const string& filename); 
00069 
00070 };
00071 
00076 class CBException {
00077 
00078  private: 
00079 
00080   string message;  
00081   string filename;
00082   int linenumber;
00083   static string DefMess;
00084   
00085  public:
00086   
00087   CBException();
00088   CBException(const string& s, const string& file, const int& line);
00089   ~CBException();
00090   string what();
00091   int get_line();
00092   string get_file();  
00093 };
00094 }  //end of namespace LcgConfigBuffer
00095 
00096 #endif

Generated on Tue Oct 5 14:42:45 2004 for LCG Information System Interface by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002