Revision 8c1dacab src/common/Attribute.cc

View differences:

src/common/Attribute.cc
244 244
/* -------------------------------------------------------------------------- */
245 245
/* -------------------------------------------------------------------------- */
246 246

  
247
int VectorAttribute::vector_value(const char *name, float & value) const
248
{
249
    map<string,string>::const_iterator it;
250

  
251
    it = attribute_value.find(name);
252

  
253
    if ( it == attribute_value.end() )
254
    {
255
        return -1;
256
    }
257

  
258
    if ( it->second.empty() )
259
    {
260
        return -1;
261
    }
262

  
263
    istringstream iss(it->second);
264
    iss >> value;
265

  
266
    return 0;
267
}
268

  
269
/* -------------------------------------------------------------------------- */
270
/* -------------------------------------------------------------------------- */
271

  
247 272
string VectorAttribute::vector_value_str(const char *name, int& value) const
248 273
{
249 274
    map<string,string>::const_iterator it;

Also available in: Unified diff