69 |
69 |
70 /****************************************************************************/ |
70 /****************************************************************************/ |
71 |
71 |
72 void CommandXml::execute(const StringVector &args) |
72 void CommandXml::execute(const StringVector &args) |
73 { |
73 { |
|
74 MasterIndexList masterIndices; |
74 SlaveList slaves; |
75 SlaveList slaves; |
75 SlaveList::const_iterator si; |
76 SlaveList::const_iterator si; |
76 |
77 |
77 if (args.size()) { |
78 if (args.size()) { |
78 stringstream err; |
79 stringstream err; |
79 err << "'" << getName() << "' takes no arguments!"; |
80 err << "'" << getName() << "' takes no arguments!"; |
80 throwInvalidUsageException(err); |
81 throwInvalidUsageException(err); |
81 } |
82 } |
82 |
83 |
83 if (getMasterIndices().size() != 1) { |
84 masterIndices = getMasterIndices(); |
|
85 if (masterIndices.size() != 1) { |
84 stringstream err; |
86 stringstream err; |
85 err << getName() << " requires to select a single master!"; |
87 err << getName() << " requires to select a single master!"; |
86 throwInvalidUsageException(err); |
88 throwInvalidUsageException(err); |
87 } |
89 } |
88 MasterDevice m(getMasterIndices().front()); |
90 MasterDevice m(masterIndices.front()); |
89 m.open(MasterDevice::Read); |
91 m.open(MasterDevice::Read); |
90 slaves = selectedSlaves(m); |
92 slaves = selectedSlaves(m); |
91 |
93 |
92 cout << "<?xml version=\"1.0\" ?>" << endl; |
94 cout << "<?xml version=\"1.0\" ?>" << endl; |
93 if (slaves.size() > 1) { |
95 if (slaves.size() > 1) { |