library/src/blockclass/BP-BlockClass.cc
// adds a try/except clause to the end of a branch (posix regexp on except)
adds a try/except clause to the end of a branch (posix regexp on except)
adds a try / except clause to the end of a branch ( posix regexp on except )
size_t Block::ccAddTryExcept
(
	char                   *command_name,
	char                   *try_this,
	size_t                  try_length,
	char                   *expect_this,
	size_t                  expect_length,
	BP_CC_MATCH_BUFF_POLICY expect_match_policy
)
{
	if(!this->cc_session)
	{
		this->AddErrorToStack((char*) "Error in Block::ccAddTryExcept(): Empty session.");
		return ERR_FAILURE;
	}
	if(!command_name)
	{
		this->AddErrorToStack((char*) "Error in Block::ccAddTryExcept(): Empty command_name.");
		return ERR_FAILURE;
	}
	if
	(
		!BP_CCAddTryExpectToCommand
		(
			this->cc_session,
			command_name,
			try_this,
			try_length,
			expect_this,
			expect_length,
			expect_match_policy
		)
	)
	{
		return ERR_FAILURE;
	}
	return ERR_SUCCESS;
}
size_t Block :: ccAddTryExcept ( char * command_name , char * try_this , size_t try_length , char * expect_this , size_t expect_length , BP_CC_MATCH_BUFF_POLICY expect_match_policy ) { if ( ! this -> cc_session ) { this -> AddErrorToStack ( ( char * ) " " ) ; return ERR_FAILURE ; } if ( ! command_name ) { this -> AddErrorToStack ( ( char * ) " " ) ; return ERR_FAILURE ; } if ( ! BP_CCAddTryExpectToCommand ( this -> cc_session , command_name , try_this , try_length , expect_this , expect_length , expect_match_policy ) ) { return ERR_FAILURE ; } return ERR_SUCCESS ; }
adds a try/except clause to the end of a branch (posix regexp on except)
adds a try / except clause to the end of a branch ( posix regexp on except )
// ensure we have a cc session // attempt to add error to block error stack // ensure we have a command name // Attempt to add try/except to command. // return indicating that the try/expect combo cannot be added // return indicating success