From 8e9063542038bc9956094192aaf56b378f4d9966 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sat, 5 Nov 2011 08:37:47 +0000 Subject: [PATCH] merge toCharIfClient and toChar --- Common/onelab.h | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/Common/onelab.h b/Common/onelab.h index 0fdea84efd..1aa1b24556 100644 --- a/Common/onelab.h +++ b/Common/onelab.h @@ -432,22 +432,13 @@ namespace onelab{ if(client.empty() || (*it)->hasClient(client)) (*it)->setChanged(changed); } - std::string toChar() - { - std::string s; - std::set<parameter*> ps; - _getAllParameters(ps); - for(std::set<parameter*>::iterator it = ps.begin(); it != ps.end(); it++) - s += (*it)->toChar() + "\n"; - return s; - } - std::string toCharIfClient(const std::string &client="") + std::string toChar(const std::string &client="") { std::string s; std::set<parameter*> ps; _getAllParameters(ps); for(std::set<parameter*>::iterator it = ps.begin(); it != ps.end(); it++) - if ((*it)->hasClient(client)) s += (*it)->toChar() + "\n"; + if(client.empty() || (*it)->hasClient(client)) s += (*it)->toChar() + "\n"; return s; } }; @@ -540,9 +531,10 @@ namespace onelab{ { return _parameterSpace.getChanged(client); } - std::string toChar(){ return _parameterSpace.toChar(); } - std::string toCharIfClient(const std::string &client="") - { return _parameterSpace.toCharIfClient(client); } + std::string toChar(const std::string &client="") + { + return _parameterSpace.toChar(client); + } }; class localClient : public client{ -- GitLab