model_server/els/src/BrowserController.cxx
/* for an array of commands that can include multiple occurences of
   cmd, for example defines -classes, defines -functions, etc., 
   return a string which replaces all these occurences with one,
   for example, defines -classes -functions. Also, fill ddSelector
   with ddKinds of all the arguments */
for an array of commands that can include multiple occurences of
cmd, for example defines -classes, defines -functions, etc.,
return a string which replaces all these occurences with one,
for example, defines -classes -functions. Also, fill ddSelector
with ddKinds of all the arguments
for an array of commands that can include multiple occurences of cmd for example defines - classes defines - functions etc . return a string which replaces all these occurences with one for example defines - classes - functions . Also fill ddSelector with ddKinds of all the arguments
void BrowserController::get_cmd_args(const genArrCharPtr& cmds,
				     char const* cmd, genString& res,
				     ddSelector& dd) const
{
  Initialize(BrowserController::get_cmd_args);
  res = "";
  int len = strlen(cmd);
  for (int i = 0; i < cmds.size(); i++)
    {
      if (strncmp(*cmds[i], cmd, len) == 0)
	{
	  res += ' ';
	  char const* arg = strchr(*cmds[i], '-');
	  res += arg;
	  char const* temp[2];
	  temp[0] = NULL;
	  temp[1] = arg;
	  Interpreter* inter = GetActiveInterpreter();
	  if (inter)
	    {
	      if (inter->SetupSelector(dd, 2, temp) < 0)
		{
		  msg("ERROR: Unknown switch: $1 for $2") << arg << eoarg << cmd << eom;
		}
	    }
	}
    }
}
void BrowserController :: get_cmd_args ( const genArrCharPtr & cmds , char const * cmd , genString & res , ddSelector & dd ) const { Initialize ( BrowserController :: get_cmd_args ) ; res = " " ; int len = strlen ( cmd ) ; for ( int i = 0 ; i < cmds . size ( ) ; i ++ ) { if ( strncmp ( * cmds [ i ] , cmd , len ) == 0 ) { res += ' ' ; char const * arg = strchr ( * cmds [ i ] , ' ' ) ; res += arg ; char const * temp [ 2 ] ; temp [ 0 ] = NULL ; temp [ 1 ] = arg ; Interpreter * inter = GetActiveInterpreter ( ) ; if ( inter ) { if ( inter -> SetupSelector ( dd , 2 , temp ) < 0 ) { msg ( " " ) << arg << eoarg << cmd << eom ; } } } } }
for an array of commands that can include multiple occurences of
cmd, for example defines -classes, defines -functions, etc.,
return a string which replaces all these occurences with one,
for example, defines -classes -functions.
for an array of commands that can include multiple occurences of cmd for example defines - classes defines - functions etc . return a string which replaces all these occurences with one for example defines - classes - functions .