diff --git a/src/musredit_qt5/mupp/Pmupp.cpp b/src/musredit_qt5/mupp/Pmupp.cpp index 382f6c20..19ede15c 100644 --- a/src/musredit_qt5/mupp/Pmupp.cpp +++ b/src/musredit_qt5/mupp/Pmupp.cpp @@ -29,7 +29,6 @@ #include #include -using namespace std; #include #include @@ -314,10 +313,10 @@ bool PParamDataHandler::ReadParamFile(const QStringList fln, QString &errorMsg) // since the db-file should now be present, just load it collection = ReadDbFile(pathName, valid, errorMsg); if (!valid) { - cerr << endl; - cerr << "----" << endl; - cerr << "**ERROR** read db-file failure (" << pathName.toLatin1().data() << "." << endl; - cerr << "----" << endl; + std::cerr << std::endl; + std::cerr << "----" << std::endl; + std::cerr << "**ERROR** read db-file failure (" << pathName.toLatin1().data() << "." << std::endl; + std::cerr << "----" << std::endl; return false; } collName.remove(".db"); @@ -336,10 +335,10 @@ bool PParamDataHandler::ReadParamFile(const QStringList fln, QString &errorMsg) int idx = fln[i].lastIndexOf("/"); if (idx == -1) { // should never happen errorMsg = QString("found '%1' which shouldn't be possible!").arg(fln[i]); - cerr << endl; - cerr << "----" << endl; - cerr << "**ERROR** " << errorMsg.toLatin1().data() << endl; - cerr << "----" << endl; + std::cerr << std::endl; + std::cerr << "----" << std::endl; + std::cerr << "**ERROR** " << errorMsg.toLatin1().data() << std::endl; + std::cerr << "----" << std::endl; return false; } QString relPath = fln[i].left(idx); @@ -369,10 +368,10 @@ bool PParamDataHandler::ReadParamFile(const QStringList fln, QString &errorMsg) fCollection.push_back(collection); } else { errorMsg = QString("unkown file type for ")+fln[i]; - cerr << endl; - cerr << "*********" << endl; - cerr << "**ERROR** " << errorMsg.toLatin1().data() << endl; - cerr << "*********" << endl; + std::cerr << std::endl; + std::cerr << "*********" << std::endl; + std::cerr << "**ERROR** " << errorMsg.toLatin1().data() << std::endl; + std::cerr << "*********" << std::endl; return false; } } @@ -399,10 +398,10 @@ PmuppCollection PParamDataHandler::ReadDbFile(const QString fln, bool &valid, QS QFile file(fln); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { errorMsg = QString("couldn't open ") + fln; - cerr << endl; - cerr << "----" << endl; - cerr << "**ERROR** " << errorMsg.toLatin1().data() << endl; - cerr << "----" << endl; + std::cerr << std::endl; + std::cerr << "----" << std::endl; + std::cerr << "**ERROR** " << errorMsg.toLatin1().data() << std::endl; + std::cerr << "----" << std::endl; valid = false; return collection; } @@ -428,10 +427,10 @@ PmuppCollection PParamDataHandler::ReadDbFile(const QString fln, bool &valid, QS token = line.split(",", QString::SkipEmptyParts); if (token.size()==0) { errorMsg = fln + QString(". No parameter tokens."); - cerr << endl; - cerr << "----" << endl; - cerr << "**ERROR** in " << errorMsg.toLatin1().data() << endl; - cerr << "----" << endl; + std::cerr << std::endl; + std::cerr << "----" << std::endl; + std::cerr << "**ERROR** in " << errorMsg.toLatin1().data() << std::endl; + std::cerr << "----" << std::endl; file.close(); valid = false; return collection; @@ -451,10 +450,10 @@ PmuppCollection PParamDataHandler::ReadDbFile(const QString fln, bool &valid, QS errorMsg += QString(" first run (#%1) has %2 params.\n").arg(collection.GetRun(0).GetNumber()).arg(collection.GetRun(0).GetNoOfParam()); errorMsg += QString(" current run (#%1) has %2 params.\n").arg(run.GetNumber()).arg(run.GetNoOfParam()); errorMsg += QString(" Inspect your db-file!"); - cerr << endl; - cerr << "----" << endl; - cerr << "**ERROR** in " << errorMsg.toLatin1().data() << endl; - cerr << "----" << endl; + std::cerr << std::endl; + std::cerr << "----" << std::endl; + std::cerr << "**ERROR** in " << errorMsg.toLatin1().data() << std::endl; + std::cerr << "----" << std::endl; file.close(); valid = false; return collection; @@ -464,20 +463,20 @@ PmuppCollection PParamDataHandler::ReadDbFile(const QString fln, bool &valid, QS run.Clear(); } else { // parameter if (token.size() != 4) { // wrong number of parameter tokens - cerr << endl; - cerr << "----" << endl; - cerr << "**ERROR** in" << fln.toLatin1().data() <<". # parameter tokens != 4." << endl; - cerr << "----" << endl; + std::cerr << std::endl; + std::cerr << "----" << std::endl; + std::cerr << "**ERROR** in" << fln.toLatin1().data() <<". # parameter tokens != 4." << std::endl; + std::cerr << "----" << std::endl; file.close(); valid = false; return collection; } subTok = token[0].split("="); if (subTok.size() != 2) { - cerr << endl; - cerr << "----" << endl; - cerr << "**ERROR** in" << fln.toLatin1().data() <<". parameter name=value token missing." << endl; - cerr << "----" << endl; + std::cerr << std::endl; + std::cerr << "----" << std::endl; + std::cerr << "**ERROR** in" << fln.toLatin1().data() <<". parameter name=value token missing." << std::endl; + std::cerr << "----" << std::endl; file.close(); valid = false; return collection; @@ -489,10 +488,10 @@ PmuppCollection PParamDataHandler::ReadDbFile(const QString fln, bool &valid, QS if (ok) { param.SetValue(dval); } else { - cerr << endl; - cerr << "----" << endl; - cerr << "**ERROR** in" << fln.toLatin1().data() <<". parameter name=value token missing or wrong?!" << endl; - cerr << "----" << endl; + std::cerr << std::endl; + std::cerr << "----" << std::endl; + std::cerr << "**ERROR** in" << fln.toLatin1().data() <<". parameter name=value token missing or wrong?!" << std::endl; + std::cerr << "----" << std::endl; file.close(); valid = false; return collection; @@ -502,10 +501,10 @@ PmuppCollection PParamDataHandler::ReadDbFile(const QString fln, bool &valid, QS if (ok) { param.SetPosErr(dval); } else { - cerr << endl; - cerr << "----" << endl; - cerr << "**ERROR** in" << fln.toLatin1().data() <<". parameter pos. error not a number?!" << endl; - cerr << "----" << endl; + std::cerr << std::endl; + std::cerr << "----" << std::endl; + std::cerr << "**ERROR** in" << fln.toLatin1().data() <<". parameter pos. error not a number?!" << std::endl; + std::cerr << "----" << std::endl; file.close(); valid = false; return collection; @@ -515,10 +514,10 @@ PmuppCollection PParamDataHandler::ReadDbFile(const QString fln, bool &valid, QS if (ok) { param.SetNegErr(dval); } else { - cerr << endl; - cerr << "----" << endl; - cerr << "**ERROR** in" << fln.toLatin1().data() <<". parameter neg. error not a number?!" << endl; - cerr << "----" << endl; + std::cerr << std::endl; + std::cerr << "----" << std::endl; + std::cerr << "**ERROR** in" << fln.toLatin1().data() <<". parameter neg. error not a number?!" << std::endl; + std::cerr << "----" << std::endl; file.close(); valid = false; return collection; @@ -528,10 +527,10 @@ PmuppCollection PParamDataHandler::ReadDbFile(const QString fln, bool &valid, QS } } if (!param_found) { - cerr << endl; - cerr << "----" << endl; - cerr << "**ERROR** in" << fln.toLatin1().data() <<". No parameter found." << endl; - cerr << "----" << endl; + std::cerr << std::endl; + std::cerr << "----" << std::endl; + std::cerr << "**ERROR** in" << fln.toLatin1().data() <<". No parameter found." << std::endl; + std::cerr << "----" << std::endl; } file.close(); @@ -557,10 +556,10 @@ PmuppCollection PParamDataHandler::ReadColumnParamFile(const QString fln, bool & QFile file(fln); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { errorMsg = QString("couldn't open ")+fln; - cerr << endl; - cerr << "----" << endl; - cerr << "**ERROR** " << errorMsg.toLatin1().data() << endl; - cerr << "----" << endl; + std::cerr << std::endl; + std::cerr << "----" << std::endl; + std::cerr << "**ERROR** " << errorMsg.toLatin1().data() << std::endl; + std::cerr << "----" << std::endl; valid = false; return collection; } @@ -608,10 +607,10 @@ PmuppCollection PParamDataHandler::ReadColumnParamFile(const QString fln, bool & // paranoia check if (token.size() != headerInfo.size()) { errorMsg = QString("size mismatch between header and parameter int line: %1 (header=%2 / param=%3)").arg(lineNo).arg(headerInfo.size()).arg(token.size()); - cerr << endl; - cerr << "----" << endl; - cerr << "**ERROR** " << errorMsg.toLatin1().data() << endl; - cerr << "----" << endl; + std::cerr << std::endl; + std::cerr << "----" << std::endl; + std::cerr << "**ERROR** " << errorMsg.toLatin1().data() << std::endl; + std::cerr << "----" << std::endl; valid = false; file.close(); return collection; @@ -623,10 +622,10 @@ PmuppCollection PParamDataHandler::ReadColumnParamFile(const QString fln, bool & dval = token[i].toDouble(&ok); if (!ok) { errorMsg = QString("unrecognized token ('%1') in line %2 (line number: %3)").arg(token[i].toLatin1().data()).arg(line.toLatin1().data()).arg(lineNo); - cerr << endl; - cerr << "----" << endl; - cerr << "**ERROR** " << errorMsg.toLatin1().data() << endl; - cerr << "----" << endl; + std::cerr << std::endl; + std::cerr << "----" << std::endl; + std::cerr << "**ERROR** " << errorMsg.toLatin1().data() << std::endl; + std::cerr << "----" << std::endl; valid = false; file.close(); return collection; @@ -966,18 +965,18 @@ void PParamDataHandler::Dump() PmuppParam param; for (int i=0; i +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-" << endl; - cout << "debug> collection name: " << fCollection[i].GetName().toLatin1().data() << endl; - cout << "debug> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-" << endl; + std::cout << "debug> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-" << std::endl; + std::cout << "debug> collection name: " << fCollection[i].GetName().toLatin1().data() << std::endl; + std::cout << "debug> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-" << std::endl; for (int j=0; j ----------------------------------" << endl; + std::cout << "debug> ----------------------------------" << std::endl; run = fCollection[i].GetRun(j); - cout << "debug>> run number: " << run.GetNumber() << endl; - cout << "debug>> run name : " << run.GetName().toLatin1().data() << endl; - cout << "debug>> ---------------------------------" << endl; + std::cout << "debug>> run number: " << run.GetNumber() << std::endl; + std::cout << "debug>> run name : " << run.GetName().toLatin1().data() << std::endl; + std::cout << "debug>> ---------------------------------" << std::endl; for (int k=0; k>> " << param.GetName().toLatin1().data() << ": " << param.GetValue() << " -+ " << param.GetNegErr() << " / " << param.GetPosErr() << endl; + std::cout << "debug>>> " << param.GetName().toLatin1().data() << ": " << param.GetValue() << " -+ " << param.GetNegErr() << " / " << param.GetPosErr() << std::endl; } } } diff --git a/src/musredit_qt5/mupp/PmuppAdmin.cpp b/src/musredit_qt5/mupp/PmuppAdmin.cpp index 0ca4644c..459fbabd 100644 --- a/src/musredit_qt5/mupp/PmuppAdmin.cpp +++ b/src/musredit_qt5/mupp/PmuppAdmin.cpp @@ -29,7 +29,6 @@ #include #include -using namespace std; #include #include @@ -501,7 +500,7 @@ void PmuppAdmin::saveRecentFiles() QVector data; QFile file(fln); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { - cerr << endl << ">> PmuppAdmin::saveRecentFile: **ERROR** Cannot open " << fln.toLatin1().data() << " for reading." << endl; + std::cerr << std::endl << ">> PmuppAdmin::saveRecentFile: **ERROR** Cannot open " << fln.toLatin1().data() << " for reading." << std::endl; return; } QTextStream fin(&file); @@ -526,7 +525,7 @@ void PmuppAdmin::saveRecentFiles() } if (i == data.size()) { - cerr << endl << ">> PmuppAdmin::saveRecentFile: **ERROR** " << fln.toLatin1().data() << " seems to be corrupt." << endl; + std::cerr << std::endl << ">> PmuppAdmin::saveRecentFile: **ERROR** " << fln.toLatin1().data() << " seems to be corrupt." << std::endl; return; } i++; @@ -536,7 +535,7 @@ void PmuppAdmin::saveRecentFiles() } if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { - cerr << endl << ">> PmuppAdmin::saveRecentFile: **ERROR** Cannot open " << fln.toLatin1().data() << " for reading." << endl; + std::cerr << std::endl << ">> PmuppAdmin::saveRecentFile: **ERROR** Cannot open " << fln.toLatin1().data() << " for reading." << std::endl; return; } fin.setDevice(&file); diff --git a/src/musredit_qt5/mupp/PmuppGui.cpp b/src/musredit_qt5/mupp/PmuppGui.cpp index c50599b3..c48760d6 100644 --- a/src/musredit_qt5/mupp/PmuppGui.cpp +++ b/src/musredit_qt5/mupp/PmuppGui.cpp @@ -34,7 +34,6 @@ #include #include -using namespace std; #include #include @@ -437,7 +436,7 @@ void PmuppGui::aboutToQuit() msqid = msgget(key, flags | S_IRUSR | S_IWUSR); if (msqid != -1) { if (msgctl(msqid, IPC_RMID, NULL) == -1) { - cerr << "**ERROR** couldn't removed the message queue (msqid=" << msqid << ")." << endl << endl; + std::cerr << "**ERROR** couldn't removed the message queue (msqid=" << msqid << ")." << std::endl << std::endl; } } } @@ -865,10 +864,10 @@ void PmuppGui::readCmdHistory() QFile file(pathName); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { - cerr << endl; - cerr << "***********" << endl; - cerr << "**WARNING** readCmdHistory(): couldn't open mupp_history.txt for reading ..." << endl;; - cerr << "***********" << endl; + std::cerr << std::endl; + std::cerr << "***********" << std::endl; + std::cerr << "**WARNING** readCmdHistory(): couldn't open mupp_history.txt for reading ..." << std::endl;; + std::cerr << "***********" << std::endl; return; } diff --git a/src/musredit_qt5/mupp/plotter/PMuppCanvas.cpp b/src/musredit_qt5/mupp/plotter/PMuppCanvas.cpp index 4d483bba..a5ed8998 100644 --- a/src/musredit_qt5/mupp/plotter/PMuppCanvas.cpp +++ b/src/musredit_qt5/mupp/plotter/PMuppCanvas.cpp @@ -30,7 +30,6 @@ #include #include #include -using namespace std; #include #include @@ -104,7 +103,7 @@ PMuppCanvas::PMuppCanvas(const Char_t *title, Int_t wtopx, Int_t wtopy, fCheckMsgQueue = new TTimer(); if (fCheckMsgQueue == 0) { fValid = false; - cerr << "**ERROR** couldn't start IPC message queue timer..." << endl; + std::cerr << "**ERROR** couldn't start IPC message queue timer..." << std::endl; return; } fCheckMsgQueue->Connect("Timeout()", "PMuppCanvas", this, "CheckIPCMsgQueue()"); @@ -199,7 +198,6 @@ void PMuppCanvas::HandleMenuPopup(Int_t id) */ void PMuppCanvas::LastCanvasClosed() { -// cout << endl << ">> in last canvas closed check ..."; if (gROOT->GetListOfCanvases()->IsEmpty()) { Done(0); } @@ -255,8 +253,8 @@ void PMuppCanvas::InitMuppCanvas(const Char_t *title, Int_t wtopx, Int_t wtopy, TString canvasName = TString("fMuppCanvas"); fMainCanvas = new TCanvas(canvasName.Data(), title, wtopx, wtopy, ww, wh); if (fMainCanvas == 0) { - cerr << endl << ">> PMuppCanvas::InitMuppCanvas(): **PANIC ERROR** Couldn't invoke " << canvasName.Data(); - cerr << endl; + std::cerr << std::endl << ">> PMuppCanvas::InitMuppCanvas(): **PANIC ERROR** Couldn't invoke " << canvasName.Data(); + std::cerr << std::endl; return; } @@ -301,16 +299,16 @@ void PMuppCanvas::CheckIPCMsgQueue() if (fFtokName.IsWhitespace()) { strncpy(str, getenv("HOME"), sizeof(str)-1); if (strlen(str) == 0) { - cerr << endl; - cerr << "**ERROR** couldn't get value of the environment variable HOME." << endl << endl; + std::cerr << std::endl; + std::cerr << "**ERROR** couldn't get value of the environment variable HOME." << std::endl << std::endl; return; } memset(str, '\0', sizeof(str)); snprintf(str, sizeof(str), "%s/.musrfit/mupp/_mupp_ftok_%d.dat", getenv("HOME"), fMuppInstance); - ifstream fin(str, ifstream::in); + std::ifstream fin(str, std::ifstream::in); if (!fin.is_open()) { - cerr << endl; - cerr << "**ERROR** couldn't open " << str << endl; + std::cerr << std::endl; + std::cerr << "**ERROR** couldn't open " << str << std::endl; return; } fin.getline(str, 1024); @@ -322,8 +320,8 @@ void PMuppCanvas::CheckIPCMsgQueue() flags = IPC_CREAT; msqid = msgget(key, flags | S_IRUSR | S_IWUSR); if (msqid == -1) { - cerr << endl; - cerr << "**ERROR** couldn't get msqid." << endl << endl; + std::cerr << std::endl; + std::cerr << "**ERROR** couldn't get msqid." << std::endl << std::endl; return; } @@ -335,7 +333,7 @@ void PMuppCanvas::CheckIPCMsgQueue() if (msgLen > 0) { status = ReadPlotData(msg.mtext); if (status != 0) { - cerr << "**ERROR** reading " << msg.mtext << endl; + std::cerr << "**ERROR** reading " << msg.mtext << std::endl; } } } @@ -348,11 +346,11 @@ void PMuppCanvas::CheckIPCMsgQueue() */ int PMuppCanvas::ReadPlotData(const Char_t *fln) { - ifstream fin(fln, ifstream::in); + std::ifstream fin(fln, std::ifstream::in); char line[1024]; if (!fin.is_open()) { - cerr << "**ERROR** Couldn't open " << fln << endl; + std::cerr << "**ERROR** Couldn't open " << fln << std::endl; return -1; } @@ -383,12 +381,12 @@ int PMuppCanvas::ReadPlotData(const Char_t *fln) str = line; tok = str.Tokenize(":,"); if (tok == 0) { - cerr << "**ERROR** Couldn't tokenize the label line." << endl; + std::cerr << "**ERROR** Couldn't tokenize the label line." << std::endl; fin.close(); return -2; } if (tok->GetEntries() < 4) { - cerr << "**ERROR** label line doesn't contain sufficient information." << endl; + std::cerr << "**ERROR** label line doesn't contain sufficient information." << std::endl; fin.close(); return -3; } @@ -408,12 +406,12 @@ int PMuppCanvas::ReadPlotData(const Char_t *fln) str = line; tok = str.Tokenize(", "); if (tok == 0) { - cerr << "**ERROR** Couldn't tokenize data line." << endl; + std::cerr << "**ERROR** Couldn't tokenize data line." << std::endl; fin.close(); return -4; } if (tok->GetEntries() != (noOfDataTokens-1)*3+1) { - cerr << "**ERROR** number of token in data line (" << tok->GetEntries() << ") is inconsistent with no of labels (" << noOfDataTokens << ")." << endl; + std::cerr << "**ERROR** number of token in data line (" << tok->GetEntries() << ") is inconsistent with no of labels (" << noOfDataTokens << ")." << std::endl; fin.close(); return -4; } @@ -426,7 +424,7 @@ int PMuppCanvas::ReadPlotData(const Char_t *fln) ostr = dynamic_cast(tok->At(0)); str = ostr->GetString(); if (!str.IsFloat()) { - cerr << "**ERROR** token found in data line is not a number (" << str << ")." << endl; + std::cerr << "**ERROR** token found in data line is not a number (" << str << ")." << std::endl; fin.close(); return -5; } @@ -439,7 +437,7 @@ int PMuppCanvas::ReadPlotData(const Char_t *fln) ostr = dynamic_cast(tok->At(i)); str = ostr->GetString(); if (!str.IsFloat()) { - cerr << "**ERROR** token found in data line is not a number (" << str << ")." << endl; + std::cerr << "**ERROR** token found in data line is not a number (" << str << ")." << std::endl; fin.close(); return -5; } @@ -449,7 +447,7 @@ int PMuppCanvas::ReadPlotData(const Char_t *fln) ostr = dynamic_cast(tok->At(i+1)); str = ostr->GetString(); if (!str.IsFloat()) { - cerr << "**ERROR** token found in data line is not a number (" << str << ")." << endl; + std::cerr << "**ERROR** token found in data line is not a number (" << str << ")." << std::endl; fin.close(); return -5; } @@ -459,7 +457,7 @@ int PMuppCanvas::ReadPlotData(const Char_t *fln) ostr = dynamic_cast(tok->At(i+2)); str = ostr->GetString(); if (!str.IsFloat()) { - cerr << "**ERROR** token found in data line is not a number (" << str << ")." << endl; + std::cerr << "**ERROR** token found in data line is not a number (" << str << ")." << std::endl; fin.close(); return -5; } @@ -480,23 +478,23 @@ int PMuppCanvas::ReadPlotData(const Char_t *fln) // check if data structure makes sense for (UInt_t i=0; i collection " << i << endl; - cerr << "debug> name : " << fPlotData[i].name << endl; - cerr << "debug> x-label : " << fPlotData[i].xLabel << endl; - cerr << "debug> x-vales : " << endl; - cerr << "debug> "; + std::cerr << "debug> collection " << i << std::endl; + std::cerr << "debug> name : " << fPlotData[i].name << std::endl; + std::cerr << "debug> x-label : " << fPlotData[i].xLabel << std::endl; + std::cerr << "debug> x-vales : " << std::endl; + std::cerr << "debug> "; for (UInt_t j=0; j y-label : " << fPlotData[i].yLabel[j] << endl; - cerr << "debug> y-values " << j << ": " << endl; + std::cerr << "debug> y-label : " << fPlotData[i].yLabel[j] << std::endl; + std::cerr << "debug> y-values " << j << ": " << std::endl; for (UInt_t k=0; k " << k << ": " << fPlotData[i].yValue[j][k].y << "(" << fPlotData[i].yValue[j][k].eYneg << "/" << fPlotData[i].yValue[j][k].eYpos << ")" << endl; + std::cerr << "debug> " << k << ": " << fPlotData[i].yValue[j][k].y << "(" << fPlotData[i].yValue[j][k].eYneg << "/" << fPlotData[i].yValue[j][k].eYpos << ")" << std::endl; } } - cerr << endl; + std::cerr << std::endl; } // feed graph objects @@ -591,12 +589,12 @@ void PMuppCanvas::UpdateGraphs() fMultiGraph = new TMultiGraph(); if (fMultiGraph == 0) { - cerr << "**ERROR** couldn't create necessary TMultiGraph object." << endl; + std::cerr << "**ERROR** couldn't create necessary TMultiGraph object." << std::endl; return; } if (fGraphE.size() == 0) { - cerr << "**ERROR** NO graphs present! This should never happen." << endl; + std::cerr << "**ERROR** NO graphs present! This should never happen." << std::endl; return; } diff --git a/src/musredit_qt5/mupp/plotter/PMuppCanvas.h b/src/musredit_qt5/mupp/plotter/PMuppCanvas.h index 16d15214..2714eef8 100644 --- a/src/musredit_qt5/mupp/plotter/PMuppCanvas.h +++ b/src/musredit_qt5/mupp/plotter/PMuppCanvas.h @@ -31,7 +31,6 @@ #define _PMUPPCANVAS_H_ #include -using namespace std; #include #include @@ -63,7 +62,7 @@ typedef struct { TString xLabel; PStringVector yLabel; PDoubleVector xValue; - vector< vector > yValue; + std::vector< std::vector > yValue; } PDataCollection; //-------------------------------------------------------------------------- @@ -95,7 +94,7 @@ private: TString fFtokName; TTimer *fCheckMsgQueue; ///< timer needed to check if a message in the IPC message queue is pending - vector fPlotData; + std::vector fPlotData; TStyle *fStyle; ///< A collection of all graphics attributes @@ -107,7 +106,7 @@ private: // canvas related variables TCanvas *fMainCanvas; ///< main canvas TMultiGraph *fMultiGraph; ///< main multi graph - vector fGraphE; ///< all error graphs + std::vector fGraphE; ///< all error graphs // perdefined markers, colors PIntVector fMarkerStyleList; diff --git a/src/musredit_qt5/mupp/plotter/PMuppStartupHandler.cpp b/src/musredit_qt5/mupp/plotter/PMuppStartupHandler.cpp index b4393ec9..3146179a 100644 --- a/src/musredit_qt5/mupp/plotter/PMuppStartupHandler.cpp +++ b/src/musredit_qt5/mupp/plotter/PMuppStartupHandler.cpp @@ -29,7 +29,6 @@ #include #include -using namespace std; #include "PMuppStartupHandler.h" @@ -53,14 +52,14 @@ ClassImpQ(PMuppStartupHandler) int parseXmlFile(TSAXParser *saxParser, const char *startup_path_name) { int status; - fstream xmlFile; + std::fstream xmlFile; unsigned int xmlSize = 0; char *xmlBuffer = 0; - xmlFile.open(startup_path_name, ios::in | ios::ate); // open file for reading and go to the end of the file + xmlFile.open(startup_path_name, std::ios::in | std::ios::ate); // open file for reading and go to the end of the file if (xmlFile.is_open()) { // check if file has been opened successfully xmlSize = xmlFile.tellg(); // get the position within the stream == size of the file (since we are at the end) - xmlFile.seekg(0, ios::beg); // go back to the beginning of the stream + xmlFile.seekg(0, std::ios::beg); // go back to the beginning of the stream xmlBuffer = new char[xmlSize]; // allocate buffer memory for the whole XML file xmlFile.read(xmlBuffer, xmlSize); // read in the whole XML file into the buffer xmlFile.close(); // close the XML file @@ -203,13 +202,13 @@ void PMuppStartupHandler::OnCharacters(const Char_t *str) tstr = TString(str); tokens = tstr.Tokenize(","); if (tokens == 0) { - cerr << endl << "PMuppStartupHandler **WARNING** '" << str << "' is not a marker code, will ignore it"; - cerr << endl; + std::cerr << std::endl << "PMuppStartupHandler **WARNING** '" << str << "' is not a marker code, will ignore it"; + std::cerr << std::endl; return; } if (tokens->GetEntries() != 2) { - cerr << endl << "PMuppStartupHandler **WARNING** '" << str << "' is not a marker code, will ignore it"; - cerr << endl; + std::cerr << std::endl << "PMuppStartupHandler **WARNING** '" << str << "' is not a marker code, will ignore it"; + std::cerr << std::endl; return; } // get marker style @@ -218,8 +217,8 @@ void PMuppStartupHandler::OnCharacters(const Char_t *str) if (tstr.IsDigit()) { fMarkerStyleList.push_back(tstr.Atoi()); } else { - cerr << endl << "PMuppStartupHandler **WARNING** marker style '" << str << "' is not a number, will ignore it"; - cerr << endl; + std::cerr << std::endl << "PMuppStartupHandler **WARNING** marker style '" << str << "' is not a number, will ignore it"; + std::cerr << std::endl; } // get marker size ostr = dynamic_cast(tokens->At(1)); @@ -227,8 +226,8 @@ void PMuppStartupHandler::OnCharacters(const Char_t *str) if (tstr.IsFloat()) { fMarkerSizeList.push_back(tstr.Atof()); } else { - cerr << endl << "PMuppStartupHandler **WARNING** marker size '" << str << "' is not a float, will ignore it"; - cerr << endl; + std::cerr << std::endl << "PMuppStartupHandler **WARNING** marker size '" << str << "' is not a float, will ignore it"; + std::cerr << std::endl; } // clean up tokens if (tokens) { @@ -242,14 +241,14 @@ void PMuppStartupHandler::OnCharacters(const Char_t *str) tokens = tstr.Tokenize(","); // check that there any tokens if (tokens == 0) { - cerr << endl << "PMuppStartupHandler **WARNING** '" << str << "' is not a rbg code, will ignore it"; - cerr << endl; + std::cerr << std::endl << "PMuppStartupHandler **WARNING** '" << str << "' is not a rbg code, will ignore it"; + std::cerr << std::endl; return; } // check there is the right number of tokens if (tokens->GetEntries() < 3) { - cerr << endl << "PMuppStartupHandler **WARNING** '" << str << "' is not a rbg code, will ignore it"; - cerr << endl; + std::cerr << std::endl << "PMuppStartupHandler **WARNING** '" << str << "' is not a rbg code, will ignore it"; + std::cerr << std::endl; return; } // get r @@ -258,8 +257,8 @@ void PMuppStartupHandler::OnCharacters(const Char_t *str) if (tstr.IsDigit()) { r = tstr.Atoi(); } else { - cerr << endl << "PMuppStartupHandler **WARNING** r within the rgb code is not a number, will ignore it"; - cerr << endl; + std::cerr << std::endl << "PMuppStartupHandler **WARNING** r within the rgb code is not a number, will ignore it"; + std::cerr << std::endl; return; } // get g @@ -268,8 +267,8 @@ void PMuppStartupHandler::OnCharacters(const Char_t *str) if (tstr.IsDigit()) { g = tstr.Atoi(); } else { - cerr << endl << "PMuppStartupHandler **WARNING** g within the rgb code is not a number, will ignore it"; - cerr << endl; + std::cerr << std::endl << "PMuppStartupHandler **WARNING** g within the rgb code is not a number, will ignore it"; + std::cerr << std::endl; return; } // get b @@ -278,8 +277,8 @@ void PMuppStartupHandler::OnCharacters(const Char_t *str) if (tstr.IsDigit()) { b = tstr.Atoi(); } else { - cerr << endl << "PMuppStartupHandler **WARNING** b within the rgb code is not a number, will ignore it"; - cerr << endl; + std::cerr << std::endl << "PMuppStartupHandler **WARNING** b within the rgb code is not a number, will ignore it"; + std::cerr << std::endl; return; } // clean up tokens @@ -320,8 +319,8 @@ void PMuppStartupHandler::OnComment(const Char_t *str) */ void PMuppStartupHandler::OnWarning(const Char_t *str) { - cerr << endl << "PMuppStartupHandler **WARNING** " << str; - cerr << endl; + std::cerr << std::endl << "PMuppStartupHandler **WARNING** " << str; + std::cerr << std::endl; } //-------------------------------------------------------------------------- @@ -334,8 +333,8 @@ void PMuppStartupHandler::OnWarning(const Char_t *str) */ void PMuppStartupHandler::OnError(const Char_t *str) { - cerr << endl << "PMuppStartupHandler **ERROR** " << str; - cerr << endl; + std::cerr << std::endl << "PMuppStartupHandler **ERROR** " << str; + std::cerr << std::endl; } //-------------------------------------------------------------------------- @@ -348,8 +347,8 @@ void PMuppStartupHandler::OnError(const Char_t *str) */ void PMuppStartupHandler::OnFatalError(const Char_t *str) { - cerr << endl << "PMuppStartupHandler **FATAL ERROR** " << str; - cerr << endl; + std::cerr << std::endl << "PMuppStartupHandler **FATAL ERROR** " << str; + std::cerr << std::endl; } //-------------------------------------------------------------------------- @@ -444,7 +443,7 @@ Bool_t PMuppStartupHandler::StartupFileExists(Char_t *fln) { Bool_t result = false; - ifstream ifile(fln); + std::ifstream ifile(fln); if (ifile.fail()) { result = false; diff --git a/src/musredit_qt5/mupp/plotter/mupp_plot.cpp b/src/musredit_qt5/mupp/plotter/mupp_plot.cpp index 6affb077..065c038f 100644 --- a/src/musredit_qt5/mupp/plotter/mupp_plot.cpp +++ b/src/musredit_qt5/mupp/plotter/mupp_plot.cpp @@ -28,7 +28,6 @@ ***************************************************************************/ #include -using namespace std; #include #include @@ -59,8 +58,8 @@ int main(int argc, char *argv[]) TSAXParser *saxParser = new TSAXParser(); PMuppStartupHandler *startupHandler = new PMuppStartupHandler(); if (!startupHandler->StartupFileFound()) { - cerr << endl << ">> mupp_plot **WARNING** couldn't find " << startupHandler->GetStartupFilePath().Data(); - cerr << endl; + std::cerr << std::endl << ">> mupp_plot **WARNING** couldn't find " << startupHandler->GetStartupFilePath().Data(); + std::cerr << std::endl; // clean up if (saxParser) { delete saxParser; @@ -78,9 +77,9 @@ int main(int argc, char *argv[]) Int_t status = parseXmlFile(saxParser, startup_path_name); // check for parse errors if (status) { // error - cerr << endl << ">> mupp_plot **WARNING** Reading/parsing mupp_startup.xml failed."; - cerr << endl << ">> Graph will appear with random symbols and colors!"; - cerr << endl; + std::cerr << std::endl << ">> mupp_plot **WARNING** Reading/parsing mupp_startup.xml failed."; + std::cerr << std::endl << ">> Graph will appear with random symbols and colors!"; + std::cerr << std::endl; // clean up if (saxParser) { delete saxParser; @@ -110,13 +109,13 @@ int main(int argc, char *argv[]) TQObject::Connect("TCanvas", "Closed()", "PMuppCanvas", muppCanvas, "LastCanvasClosed()"); muppCanvas->Connect("Done(Int_t)", "TApplication", &app, "Terminate(Int_t)"); } else { - cerr << endl << ">> mupp_plot **SEVERE ERROR** invoke object is invalid, will quit."; - cerr << endl; + std::cerr << std::endl << ">> mupp_plot **SEVERE ERROR** invoke object is invalid, will quit."; + std::cerr << std::endl; ok = false; } } else { - cerr << endl << ">> mupp_plot **SEVERE ERROR** Couldn't invoke all necessary objects, will quit."; - cerr << endl; + std::cerr << std::endl << ">> mupp_plot **SEVERE ERROR** Couldn't invoke all necessary objects, will quit."; + std::cerr << std::endl; ok = false; } diff --git a/src/musredit_qt5/mupp/plotter/mupp_plot.h b/src/musredit_qt5/mupp/plotter/mupp_plot.h index 3fc21264..ca0c0ef6 100644 --- a/src/musredit_qt5/mupp/plotter/mupp_plot.h +++ b/src/musredit_qt5/mupp/plotter/mupp_plot.h @@ -31,7 +31,7 @@ #define _MUPP_PLOT_H_ #include -using namespace std; +#include #include #include @@ -40,54 +40,54 @@ using namespace std; /** *

typedef to make to code more readable. Definition of a bool vector. */ -typedef vector PBoolVector; +typedef std::vector PBoolVector; //------------------------------------------------------------- /** *

typedef to make to code more readable. Definition of an unsigned int vector */ -typedef vector PUIntVector; +typedef std::vector PUIntVector; //------------------------------------------------------------- /** *

typedef to make to code more readable. Definition of an int vector */ -typedef vector PIntVector; +typedef std::vector PIntVector; //------------------------------------------------------------- /** *

typedef to make to code more readable. Definition of an int pair */ -typedef pair PIntPair; +typedef std::pair PIntPair; //------------------------------------------------------------- /** *

typedef to make to code more readable. Definition of an int pair vector */ -typedef vector PIntPairVector; +typedef std::vector PIntPairVector; //------------------------------------------------------------- /** *

typedef to make to code more readable. Definition of a double vector */ -typedef vector PDoubleVector; +typedef std::vector PDoubleVector; //------------------------------------------------------------- /** *

typedef to make to code more readable. Definition of a double pair */ -typedef pair PDoublePair; +typedef std::pair PDoublePair; //------------------------------------------------------------- /** *

typedef to make to code more readable. Definition of a double pair vector */ -typedef vector PDoublePairVector; +typedef std::vector PDoublePairVector; //------------------------------------------------------------- /** *

typedef to make to code more readable. Definition of a string vector */ -typedef vector PStringVector; +typedef std::vector PStringVector; #endif // _MUPP_PLOT_H_