library/src/utility/BP-StringUtilities.cc
// Display an array of strings.  This is primarily a utility routine to assist in development
// related tasks, such as verifying exploded data content.
Display an array of strings.  This is primarily a utility routine to assist in development
related tasks, such as verifying exploded data content.
Display an array of strings . This is primarily a utility routine to assist in development related tasks such as verifying exploded data content .
BP_ERROR_T BP_DisplayStringArray(char * prefix, size_t new_lines_between_item, size_t tabs_before_item, char **array)
{
	if(!array)
		return ERR_FAILURE;
	size_t n = 0;
	size_t j = 0;
	size_t i = 0;
	for(; array[n]; n++)
	{
		for(i = 0; i < tabs_before_item; i++)
			printf("\t");
		if(prefix)
			printf("%s", prefix);
		printf("%s", array[n]);
		for(j = 0; j < new_lines_between_item; j++)
			printf("\n");
	}
	return ERR_SUCCESS;
}
BP_ERROR_T BP_DisplayStringArray ( char * prefix , size_t new_lines_between_item , size_t tabs_before_item , char * * array ) { if ( ! array ) return ERR_FAILURE ; size_t n = 0 ; size_t j = 0 ; size_t i = 0 ; for ( ; array [ n ] ; n ++ ) { for ( i = 0 ; i < tabs_before_item ; i ++ ) printf ( " \t " ) ; if ( prefix ) printf ( " " , prefix ) ; printf ( " " , array [ n ] ) ; for ( j = 0 ; j < new_lines_between_item ; j ++ ) printf ( " \n " ) ; } return ERR_SUCCESS ; }
Display an array of strings.
Display an array of strings .
// ensure we have an array to work with // walk items and display // add tabs first // display the prefix // display the item // display set newlines // return indicating success