model_server/els/src/BrowserData.cxx
/* all queries should be defined on one line with the following format:
   <ws>"Query name"<ws>"Access command"<ws><SubmenuIndex> */
all queries should be defined on one line with the following format:
"Query name""Access command"
all queries should be defined on one line with the following format : " Query name " " Access command "
bool BrowserData::read_query_section(FILE* input)
{
  Initialize(BrowserData::read_query_section);
    char buf[MAXBUF];
    while(get_next_line(input, buf, m_LineNum))
    {
	char name[MAXBUF];
	char command[MAXBUF];
	int submenu;
	char* next = extract_str(buf, '"', '"', name);
	if (next == NULL)
	  {
	    msg("ERROR: $1 Line $2: Syntax error") << m_FileName << eoarg << m_LineNum << eom;
	    continue;
	  }
	next = extract_str(next, '"', '"', command);
	if (next == NULL)
	  {	
	    msg("ERROR: $1 Line $2: Access command for \'$3\' is not specified") << m_FileName << eoarg << m_LineNum << eoarg << name << eom;
	    continue;
	  }  
	next = extract_num(next, submenu);
	if (next == NULL)
	  {
	    submenu = -1;
	  }
	else if (submenu >= (int)m_submenus.size())
	  {
	    msg("ERROR: $1 Line $2: Submenu index $3 for \'$4\' is out of range\nMake sure that submenu with this index was defined in Submenu section") << m_FileName << eoarg << m_LineNum << eoarg << submenu << eoarg << name << eom;
	    submenu = -1;
	  }
	add_query(name, command, submenu);	
    }
    return true;
}
bool BrowserData :: read_query_section ( FILE * input ) { Initialize ( BrowserData :: read_query_section ) ; char buf [ MAXBUF ] ; while ( get_next_line ( input , buf , m_LineNum ) ) { char name [ MAXBUF ] ; char command [ MAXBUF ] ; int submenu ; char * next = extract_str ( buf , ' ' , ' ' , name ) ; if ( next == NULL ) { msg ( " " ) << m_FileName << eoarg << m_LineNum << eom ; continue ; } next = extract_str ( next , ' ' , ' ' , command ) ; if ( next == NULL ) { msg ( " \' \' " ) << m_FileName << eoarg << m_LineNum << eoarg << name << eom ; continue ; } next = extract_num ( next , submenu ) ; if ( next == NULL ) { submenu = -1 ; } else if ( submenu >= ( int ) m_submenus . size ( ) ) { msg ( " \' \' \n " ) << m_FileName << eoarg << m_LineNum << eoarg << submenu << eoarg << name << eom ; submenu = -1 ; } add_query ( name , command , submenu ) ; } return true ; }
all queries should be defined on one line with the following format:
<ws>"Query name"<ws>"Access command"<ws><SubmenuIndex>
all queries should be defined on one line with the following format : <ws > " Query name " <ws > " Access command " <ws > <SubmenuIndex >