X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=TTherminator%2FTherminator%2FReadPar.cxx;h=1251653cfa76bb6a0a6de38dd190e87bd9739ffe;hp=cb193f2631e9624e05ee0323701c5bb9faf7d47b;hb=HEAD;hpb=2e9679195eb6ff424774adcc2010861a8517fdaf diff --git a/TTherminator/Therminator/ReadPar.cxx b/TTherminator/Therminator/ReadPar.cxx index cb193f2631e..1251653cfa7 100644 --- a/TTherminator/Therminator/ReadPar.cxx +++ b/TTherminator/Therminator/ReadPar.cxx @@ -30,6 +30,7 @@ #include #include #include +#include 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(""); }