libs/stream_message/src/msg_format.cxx
//This function parses the text passed to "msg" function and breaks it up into
//an array of message components separated by argument(s)
This function parses the text passed to "msg" function and breaks it up into
an array of message components separated by argument(s)
This function parses the text passed to " msg " function and breaks it up into an array of message components separated by argument ( s )
int msg_ostream::parse_message()
{
  int ret_val = 0, st_ind = 0, ind = 0, found = -1;
  const string& message = get_format_string();
  do {
    found = message.find(ARG_KEY, ind);
	ind = (found >= 0) ? found : message.size();
	if (!ind || message.at(ind-1) != BACK_SLASH ) {
	  msg_arr.push_back(message.substr(st_ind, ind-st_ind));
	  if (found >= 0 ) args_cnt++;
	  if ( ind < message.size()) {
		do {
		  ind++;
		  if ( ind >= message.size() )
			break;
		} while (isdigit(message.at(ind)));
	  }
	  st_ind = ind;
	}
	else {
      if ( ind == message.size() -1 ) {
	    msg_arr.push_back(message.substr(st_ind, ind-st_ind+1));
	  }
	  ind++;
	}
  } while (ind < message.size());
  return ret_val;
}
int msg_ostream :: parse_message ( ) { int ret_val = 0 , st_ind = 0 , ind = 0 , found = -1 ; const string & message = get_format_string ( ) ; do { found = message . find ( ARG_KEY , ind ) ; ind = ( found >= 0 ) ? found : message . size ( ) ; if ( ! ind || message . at ( ind - 1 ) != BACK_SLASH ) { msg_arr . push_back ( message . substr ( st_ind , ind - st_ind ) ) ; if ( found >= 0 ) args_cnt ++ ; if ( ind < message . size ( ) ) { do { ind ++ ; if ( ind >= message . size ( ) ) break ; } while ( isdigit ( message . at ( ind ) ) ) ; } st_ind = ind ; } else { if ( ind == message . size ( ) - 1 ) { msg_arr . push_back ( message . substr ( st_ind , ind - st_ind + 1 ) ) ; } ind ++ ; } } while ( ind < message . size ( ) ) ; return ret_val ; }
This function parses the text passed to "msg" function and breaks it up into
an array of message components separated by argument(s)
This function parses the text passed to " msg " function and breaks it up into an array of message components separated by argument ( s )
//add this component of message to msg_arr and increment args_cnt //incr the argument counter //while char is number increment ind, to skip argument number that follows $