library/src/databases/bpdb/BP-DB.cc
// Attempts to convert BLOB column result data to base64 encoded output.
Attempts to convert BLOB column result data to base64 encoded output.
Attempts to convert BLOB column result data to base64 encoded output .
char * BP_DBMariadbConvertBlobColumnResultDataToJSONData(MYSQL_BIND * col_bind_info, BPDB_MARIADB_COLUMN_TYPE type)
{
	if(!col_bind_info)
		return NULL;
	if(!col_bind_info->buffer)
		return NULL;
	char *ret_buff = NULL;
	switch(type)
	{
		case BPDB_MARIADB_COLUMN_TYPE_CHAR:
		case BPDB_MARIADB_COLUMN_TYPE_VARCHAR:
		case BPDB_MARIADB_COLUMN_TYPE_BINARY:
		case BPDB_MARIADB_COLUMN_TYPE_VARBINARY:
		case BPDB_MARIADB_COLUMN_TYPE_TINYBLOB:
		case BPDB_MARIADB_COLUMN_TYPE_BLOB:
		case BPDB_MARIADB_COLUMN_TYPE_MEDIUMBLOB:
		case BPDB_MARIADB_COLUMN_TYPE_LONGBLOB:
		case BPDB_MARIADB_COLUMN_TYPE_TINYTEXT:
		case BPDB_MARIADB_COLUMN_TYPE_TEXT:
		case BPDB_MARIADB_COLUMN_TYPE_MEDIUMTEXT:
		case BPDB_MARIADB_COLUMN_TYPE_LONGTEXT:
			ret_buff = BP_Base64Encode((unsigned char *) col_bind_info->buffer, col_bind_info->buffer_length);
			break;
		default:
			break;
	}
	return ret_buff;
}
char * BP_DBMariadbConvertBlobColumnResultDataToJSONData ( MYSQL_BIND * col_bind_info , BPDB_MARIADB_COLUMN_TYPE type ) { if ( ! col_bind_info ) return NULL ; if ( ! col_bind_info -> buffer ) return NULL ; char * ret_buff = NULL ; switch ( type ) { case BPDB_MARIADB_COLUMN_TYPE_CHAR : case BPDB_MARIADB_COLUMN_TYPE_VARCHAR : case BPDB_MARIADB_COLUMN_TYPE_BINARY : case BPDB_MARIADB_COLUMN_TYPE_VARBINARY : case BPDB_MARIADB_COLUMN_TYPE_TINYBLOB : case BPDB_MARIADB_COLUMN_TYPE_BLOB : case BPDB_MARIADB_COLUMN_TYPE_MEDIUMBLOB : case BPDB_MARIADB_COLUMN_TYPE_LONGBLOB : case BPDB_MARIADB_COLUMN_TYPE_TINYTEXT : case BPDB_MARIADB_COLUMN_TYPE_TEXT : case BPDB_MARIADB_COLUMN_TYPE_MEDIUMTEXT : case BPDB_MARIADB_COLUMN_TYPE_LONGTEXT : ret_buff = BP_Base64Encode ( ( unsigned char * ) col_bind_info -> buffer , col_bind_info -> buffer_length ) ; break ; default : break ; } return ret_buff ; }
Attempts to convert BLOB column result data to base64 encoded output.
Attempts to convert BLOB column result data to base64 encoded output .
// ensure we have bind info // return buffer // switch on type // binary blob types // create encode and return the buffer // return the buffer