Functions to get obiblobs through views
This commit is contained in:
@ -20,6 +20,7 @@
|
||||
#include "obidms.h"
|
||||
#include "obidmscolumn.h"
|
||||
#include "obidmscolumn_idx.h"
|
||||
#include "obidmscolumn_blob.h"
|
||||
#include "obidmscolumn_bool.h"
|
||||
#include "obidmscolumn_char.h"
|
||||
#include "obidmscolumn_float.h"
|
||||
@ -32,6 +33,7 @@
|
||||
#include "obilittlebigman.h"
|
||||
#include "hashtable.h"
|
||||
#include "utils.h"
|
||||
#include "obiblob.h"
|
||||
|
||||
|
||||
#define DEBUG_LEVEL 0 // TODO has to be defined somewhere else (cython compil flag?)
|
||||
@ -2000,6 +2002,44 @@ int obi_save_and_close_view(Obiview_p view)
|
||||
}
|
||||
|
||||
|
||||
/*********** FOR BLOB COLUMNS ***********/
|
||||
|
||||
Obi_blob_p obi_get_blob_with_elt_idx_and_col_p_in_view(Obiview_p view, OBIDMS_column_p column_p, index_t line_nb, index_t element_idx)
|
||||
{
|
||||
if (prepare_to_get_value_from_column(view, &line_nb) < 0)
|
||||
return OBIBlob_NA;
|
||||
return obi_column_get_blob_with_elt_idx(column_p, line_nb, element_idx);
|
||||
}
|
||||
|
||||
|
||||
Obi_blob_p obi_get_blob_with_elt_name_and_col_p_in_view(Obiview_p view, OBIDMS_column_p column_p, index_t line_nb, const char* element_name)
|
||||
{
|
||||
index_t element_idx = obi_column_get_element_index_from_name(column_p, element_name);
|
||||
if (element_idx == OBIIdx_NA)
|
||||
return OBIBlob_NA;
|
||||
return obi_get_blob_with_elt_idx_and_col_p_in_view(view, column_p, line_nb, element_idx);
|
||||
}
|
||||
|
||||
|
||||
Obi_blob_p obi_get_blob_with_elt_idx_and_col_name_in_view(Obiview_p view, const char* column_name, index_t line_nb, index_t element_idx)
|
||||
{
|
||||
OBIDMS_column_p column_p;
|
||||
column_p = obi_view_get_column(view, column_name);
|
||||
if (column_p == NULL)
|
||||
return OBIBlob_NA;
|
||||
return obi_get_blob_with_elt_idx_and_col_p_in_view(view, column_p, line_nb, element_idx);
|
||||
}
|
||||
|
||||
|
||||
Obi_blob_p obi_get_blob_with_elt_name_and_col_name_in_view(Obiview_p view, const char* column_name, index_t line_nb, const char* element_name)
|
||||
{
|
||||
OBIDMS_column_p column_p;
|
||||
column_p = obi_view_get_column(view, column_name);
|
||||
if (column_p == NULL)
|
||||
return OBIBlob_NA;
|
||||
return obi_get_blob_with_elt_name_and_col_p_in_view(view, column_p, line_nb, element_name);
|
||||
}
|
||||
|
||||
/*********** FOR BOOL COLUMNS ***********/
|
||||
|
||||
int obi_set_bool_with_elt_idx_and_col_p_in_view(Obiview_p view, OBIDMS_column_p column_p, index_t line_nb, index_t element_idx, obibool_t value)
|
||||
|
Reference in New Issue
Block a user