library/src/utility/BP-StringUtilities.cc
// This attempts to determine if a string is reasonable for a signed integer value.
This attempts to determine if a string is reasonable for a signed integer value.
This attempts to determine if a string is reasonable for a signed integer value .
BP_BOOL BP_StringIsReasonableForSignedIntegerASCII
(
		char * string_to_analyze,
		size_t string_len
)
{
	if(!string_to_analyze)
		return BP_FALSE;
	if(!string_len)
		return BP_FALSE;
	if(string_to_analyze[0] == '-')
	{
		return BP_StringIsReasonableForUnsignedIntegerASCII
		(
			(char *) &string_to_analyze[1],
			string_len-1
		);
	}
	else
	{
		return BP_StringIsReasonableForUnsignedIntegerASCII
		(
			(char *) &string_to_analyze[0],
			string_len-1
		);
	}
	return BP_FALSE;
}
BP_BOOL BP_StringIsReasonableForSignedIntegerASCII ( char * string_to_analyze , size_t string_len ) { if ( ! string_to_analyze ) return BP_FALSE ; if ( ! string_len ) return BP_FALSE ; if ( string_to_analyze [ 0 ] == ' ' ) { return BP_StringIsReasonableForUnsignedIntegerASCII ( ( char * ) & string_to_analyze [ 1 ] , string_len - 1 ) ; } else { return BP_StringIsReasonableForUnsignedIntegerASCII ( ( char * ) & string_to_analyze [ 0 ] , string_len - 1 ) ; } return BP_FALSE ; }
This attempts to determine if a string is reasonable for a signed integer value.
This attempts to determine if a string is reasonable for a signed integer value .
// run basic checks // run checks based on positions // should never get here