fixed a bug
This commit is contained in:
@ -617,7 +617,7 @@ public:
|
||||
*
|
||||
* Accepts arguments of the form field='value' where value is json syntax.
|
||||
* field is name.name...
|
||||
* @parm args The arguments
|
||||
* @param args The arguments
|
||||
* @throw runtime_error if failure.
|
||||
*/
|
||||
void parse(const std::vector<std::string> &args);
|
||||
|
@ -156,19 +156,22 @@ void PvaClientData::parse(const std::vector<std::string> &args)
|
||||
if(!pvStructure) throw std::runtime_error(messagePrefix + noStructure);
|
||||
if(!bitSet) throw std::runtime_error(messagePrefix + noStructure);
|
||||
size_t num = args.size();
|
||||
if(num<1) throw std::runtime_error(messagePrefix + " no arguments");
|
||||
for(size_t i=0; i<num; ++i)
|
||||
{
|
||||
string val = args[i];
|
||||
size_t iequals = val.find_first_of('=');
|
||||
string field;
|
||||
string rest(val);
|
||||
if(iequals!=std::string::npos) {
|
||||
field = val.substr(0,iequals);
|
||||
rest = val.substr(iequals+1);
|
||||
if(iequals==std::string::npos) {
|
||||
parse(rest,pvStructure,bitSet);
|
||||
continue;
|
||||
}
|
||||
field = val.substr(0,iequals);
|
||||
rest = val.substr(iequals+1);
|
||||
if(field.size()==std::string::npos) {
|
||||
parse(rest,pvStructure,bitSet);
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
PVFieldPtr pvField(pvStructure->getSubField(field));
|
||||
// look for enumerated structure
|
||||
|
Reference in New Issue
Block a user