Update master to aliroot
[u/mrichter/AliRoot.git] / TTherminator / Therminator / ReadPar.cxx
index cb193f2631e9624e05ee0323701c5bb9faf7d47b..1251653cfa76bb6a0a6de38dd190e87bd9739ffe 100644 (file)
@@ -30,6 +30,7 @@
 #include <fstream>
 #include <sstream>
 #include <iosfwd>
+#include <stdlib.h>
 
 ReadPar::ReadPar()
 {
@@ -42,6 +43,29 @@ ReadPar::ReadPar(const char *aFName)
   readFile(aFName);
 }
 
+ReadPar::ReadPar(const ReadPar &aPar)
+{
+  fname = strdup(aPar.fname);
+  readFile(fname);
+}
+
+ReadPar& ReadPar::operator=(const ReadPar& aPar)
+{
+  if (this != &aPar) {
+    delete fname;
+    fname = strdup(aPar.fname);
+    readFile(fname);
+  }
+  
+  return *this;
+}
+
+ReadPar::~ReadPar()
+{
+  if (fname)
+    free(fname);
+}
+
 int ReadPar::readFile(const char *aFName) throw (int)
 {
   option read_opt;
@@ -108,7 +132,7 @@ STR ReadPar::getPar(const char *name) throw(STR)
       }
   throw *(new STR(name));
 
-  return TString("");
+  //  return TString("");
 }