QGTextFileHandler.hh

Go to the documentation of this file.
00001 #ifndef _QG_TEXT_FILE_HANDLER_HH_
00002 #define _QG_TEXT_FILE_HANDLER_HH_
00003 
00011 #include <map>
00012 #include <string>
00013 #include <vector>
00014 #include <utility>
00015 #include "Rtypes.h"
00016 
00017 class QGTextFileHandler {
00018 public:
00020     QGTextFileHandler();
00021     
00023     virtual ~QGTextFileHandler();
00024     
00026     void AppendLine(std::string key = "", std::string value = "");
00027 
00029     void AppendLine(std::string key, Double_t value);
00030 
00032     void AppendLine(std::string key, Int_t value);
00033 
00035     bool DoesKeyExist(std::string key);
00036     
00038     const std::vector<std::pair<std::string, std::string> >& GetLines() {return fFileLines;}
00039 
00041     std::string GetValue(std::string key);
00042 
00044     bool ReadFile(std::string filename);
00045     
00047     bool WriteFile(std::string filename);
00048     
00049 private:
00051     std::pair<std::string, std::string> ParseLine(const std::string& line);
00052     
00054     std::string BuildLine(const std::pair<std::string, std::string>& parsedLine);
00055 
00057     std::map<std::string, std::string> fFileMap;
00058     
00060     std::vector<std::pair<std::string, std::string> > fFileLines;
00061     
00062     ClassDef(QGTextFileHandler, 0)
00063 };
00064 
00065 #endif

Generated on Tue Nov 16 10:49:56 2010 for CUORE Software by  doxygen 1.5.6