Major update: New column type to store sequence qualities. Closes #41
This commit is contained in:
@ -14,6 +14,7 @@
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "char_str_indexer.h"
|
||||
#include "obiblob.h"
|
||||
#include "obiblob_indexer.h"
|
||||
#include "obidebug.h"
|
||||
@ -25,24 +26,16 @@
|
||||
|
||||
Obi_blob_p obi_str_to_blob(const char* value)
|
||||
{
|
||||
Obi_blob_p value_b;
|
||||
int32_t length;
|
||||
int32_t length;
|
||||
|
||||
// Compute the number of bytes on which the value will be encoded
|
||||
length = strlen(value) + 1; // +1 to store \0 at the end (makes retrieving faster)
|
||||
|
||||
value_b = obi_blob((byte_t*)value, ELEMENT_SIZE_STR, length, length);
|
||||
if (value_b == NULL)
|
||||
{
|
||||
obidebug(1, "\nError encoding a character string in a blob");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return value_b;
|
||||
return obi_blob((byte_t*)value, ELEMENT_SIZE_STR, length, length);
|
||||
}
|
||||
|
||||
|
||||
char* obi_blob_to_str(Obi_blob_p value_b)
|
||||
const char* obi_blob_to_str(Obi_blob_p value_b)
|
||||
{
|
||||
return value_b->value;
|
||||
}
|
||||
@ -67,7 +60,7 @@ index_t obi_index_char_str(Obi_indexer_p indexer, const char* value)
|
||||
}
|
||||
|
||||
|
||||
char* obi_retrieve_char_str(Obi_indexer_p indexer, index_t idx)
|
||||
const char* obi_retrieve_char_str(Obi_indexer_p indexer, index_t idx)
|
||||
{
|
||||
Obi_blob_p value_b;
|
||||
|
||||
|
Reference in New Issue
Block a user