Changeset 292 in pacpusframework for trunk/src/PacpusLib/ComponentBase.cpp
- Timestamp:
- Mar 27, 2014, 3:50:10 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/PacpusLib/ComponentBase.cpp
r290 r292 25 25 using namespace std; 26 26 27 vector<string> convertAttributesToArgumentVector(const QDomNamedNodeMap& attributes);27 //vector<string> convertAttributesToArgumentVector(QDomNamedNodeMap const& attributes); 28 28 29 29 namespace std … … 31 31 32 32 template <typename _Elem, typename _Traits> 33 std::basic_ostream<_Elem, _Traits> & operator<<(std::basic_ostream<_Elem, _Traits> & os, const boost::program_options::variables_map& vm)33 std::basic_ostream<_Elem, _Traits>& operator<<(std::basic_ostream<_Elem, _Traits>& os, boost::program_options::variables_map const& vm) 34 34 { 35 35 for (po::variables_map::const_iterator i = vm.begin(); i != vm.end(); ++i) { … … 86 86 { 87 87 LOG_TRACE("constructor"); 88 88 89 // Get a pointer on the instance of ComponentManager. 89 90 m_manager = ComponentManager::getInstance(); … … 552 553 } 553 554 554 vector<string> convertAttributesToArgumentVector(const QDomNamedNodeMap & attributes)555 {556 vector<string> xargs;557 xargs.reserve(attributes.size());558 559 for (int i = 0; i < attributes.size(); ++i) {560 QDomAttr parameter = attributes.item(i).toAttr();561 if (parameter.isNull()) {562 LOG_WARN("node is not a parameter");563 continue;564 }565 566 QString arg = QString("--") + parameter.name() + "=";567 568 bool shouldAddQuotes = parameter.value().contains(' ');569 if (shouldAddQuotes) {570 arg += '\"';571 arg += parameter.value();572 arg += '\"';573 } else {574 arg += parameter.value();575 }576 577 LOG_DEBUG("parameter: " << arg);578 xargs.push_back(arg.toStdString());579 }580 581 return xargs;582 }555 //vector<string> convertAttributesToArgumentVector(const QDomNamedNodeMap & attributes) 556 //{ 557 // vector<string> xargs; 558 // xargs.reserve(attributes.size()); 559 // 560 // for (int i = 0; i < attributes.size(); ++i) { 561 // QDomAttr parameter = attributes.item(i).toAttr(); 562 // if (parameter.isNull()) { 563 // LOG_WARN("node is not a parameter"); 564 // continue; 565 // } 566 // 567 // QString arg = QString("--") + parameter.name() + "="; 568 // 569 // bool shouldAddQuotes = parameter.value().contains(' '); 570 // if (shouldAddQuotes) { 571 // arg += '\"'; 572 // arg += parameter.value(); 573 // arg += '\"'; 574 // } else { 575 // arg += parameter.value(); 576 // } 577 // 578 // LOG_DEBUG("parameter: " << arg); 579 // xargs.push_back(arg.toStdString()); 580 // } 581 // 582 // return xargs; 583 //}
Note:
See TracChangeset
for help on using the changeset viewer.