model_server/els/src/str_utils.cxx
/*****************************************************************/
/* parse a list of the form <ws>AttName<ws>AttName... 
   and return result in attributes array */
parse a list of the form AttNameAttName
and return result in attributes array
parse a list of the form AttNameAttName and return result in attributes array
void ParseAttributeList(const char* list, objArr& attributes,
			const char* FileName, int LineNum)
{
  Initialize(ParseAttributeList);
  char* next = (char*) list;
  while (*next)
    {
      while (*next && isspace(*next))
	++next;
      if (*next == '\0')
	break;
      char* start = next;
      while (!isspace(*next) && *next != '\0')
	++next;
      char old = *next;
      *next = '\0';
      symbolAttribute* att = symbolAttribute::get_by_name(start);
      if (att)
	{
	  attributes.insert_last(att);
	}
      else
	{
	  msg("ERROR: $1 Line $2: Attribute $3 is not defined") << FileName << eoarg << LineNum << eoarg << start << eom;
	}
      *next = old;
    }
}
void ParseAttributeList ( const char * list , objArr & attributes , const char * FileName , int LineNum ) { Initialize ( ParseAttributeList ) ; char * next = ( char * ) list ; while ( * next ) { while ( * next && isspace ( * next ) ) ++ next ; if ( * next == ' \0 ' ) break ; char * start = next ; while ( ! isspace ( * next ) && * next != ' \0 ' ) ++ next ; char old = * next ; * next = ' \0 ' ; symbolAttribute * att = symbolAttribute :: get_by_name ( start ) ; if ( att ) { attributes . insert_last ( att ) ; } else { msg ( " " ) << FileName << eoarg << LineNum << eoarg << start << eom ; } * next = old ; } }
parse a list of the form <ws>AttName<ws>AttName...
and return result in attributes array
parse a list of the form <ws > AttName<ws > AttName ... and return result in attributes array