tool/Command.cpp
changeset 1155 bd4e5b544473
parent 1151 1fc1535dec29
child 1156 ecaf2a896ea3
equal deleted inserted replaced
1154:04bcd38cf8dc 1155:bd4e5b544473
    78     return str.str();
    78     return str.str();
    79 }
    79 }
    80 
    80 
    81 /*****************************************************************************/
    81 /*****************************************************************************/
    82 
    82 
    83 void Command::throwInvalidUsageException(const stringstream &s)
    83 void Command::throwInvalidUsageException(const stringstream &s) const
    84 {
    84 {
    85     throw InvalidUsageException(s);
    85     throw InvalidUsageException(s);
    86 }
    86 }
    87 
    87 
    88 /*****************************************************************************/
    88 /*****************************************************************************/
    89 
    89 
    90 void Command::throwCommandException(const stringstream &s)
    90 void Command::throwCommandException(const stringstream &s) const
    91 {
    91 {
    92     throw CommandException(s);
    92     throw CommandException(s);
       
    93 }
       
    94 
       
    95 /*****************************************************************************/
       
    96 
       
    97 void Command::throwSingleSlaveRequired(unsigned int size) const
       
    98 {
       
    99     stringstream err;
       
   100 
       
   101     err << "The slave selection matches " << size << "slaves. '"
       
   102         << name << "' requires a single slave.";
       
   103 
       
   104     throwInvalidUsageException(err);
    93 }
   105 }
    94 
   106 
    95 /*****************************************************************************/
   107 /*****************************************************************************/
    96 
   108 
    97 Command::SlaveList Command::selectedSlaves(MasterDevice &m)
   109 Command::SlaveList Command::selectedSlaves(MasterDevice &m)