Finished adding all the functions to directly set and get indices in
columns containing indices referring to any type of data.
This commit is contained in:
@ -1263,9 +1263,9 @@ Obiview_p obi_new_view(OBIDMS_p dms, const char* view_name, Obiview_p view_to_cl
|
||||
}
|
||||
|
||||
if (view_to_clone->line_selection != NULL)
|
||||
line_nb = obi_column_get_index(view_to_clone->line_selection, line_nb);
|
||||
line_nb = obi_column_get_index_with_elt_idx(view_to_clone->line_selection, line_nb, 0);
|
||||
|
||||
if (obi_column_set_index(view->line_selection, ((view->line_selection)->header)->lines_used, line_nb) < 0)
|
||||
if (obi_column_set_index_with_elt_idx(view->line_selection, ((view->line_selection)->header)->lines_used, 0, line_nb) < 0)
|
||||
{
|
||||
obi_close_column(view->line_selection);
|
||||
obi_view_unmap_file(view->dms, view->infos);
|
||||
@ -2724,6 +2724,15 @@ const char* obi_get_str_with_elt_name_and_col_name_in_view(Obiview_p view, const
|
||||
|
||||
/*********** FOR COLUMNS WITH INDEXED VALUES ***********/
|
||||
|
||||
|
||||
int obi_set_index_with_elt_idx_and_col_p_in_view(Obiview_p view, OBIDMS_column_p column, index_t line_nb, index_t element_idx, index_t value)
|
||||
{
|
||||
if (prepare_to_set_value_in_column(view, &column, &line_nb) < 0)
|
||||
return -1;
|
||||
return obi_column_set_index_with_elt_idx(column, line_nb, element_idx, value);
|
||||
}
|
||||
|
||||
|
||||
index_t obi_get_index_with_elt_idx_and_col_p_in_view(Obiview_p view, OBIDMS_column_p column, index_t line_nb, index_t element_idx)
|
||||
{
|
||||
if (prepare_to_get_value_from_column(view, &line_nb) < 0)
|
||||
@ -2732,6 +2741,15 @@ index_t obi_get_index_with_elt_idx_and_col_p_in_view(Obiview_p view, OBIDMS_colu
|
||||
}
|
||||
|
||||
|
||||
int obi_set_index_with_elt_name_and_col_p_in_view(Obiview_p view, OBIDMS_column_p column, index_t line_nb, const char* element_name, index_t value)
|
||||
{
|
||||
index_t element_idx = obi_column_get_element_index_from_name(column, element_name);
|
||||
if (element_idx == OBIIdx_NA)
|
||||
return -1;
|
||||
return obi_set_index_with_elt_idx_and_col_p_in_view(view, column, line_nb, element_idx, value);
|
||||
}
|
||||
|
||||
|
||||
index_t obi_get_index_with_elt_name_and_col_p_in_view(Obiview_p view, OBIDMS_column_p column, index_t line_nb, const char* element_name)
|
||||
{
|
||||
index_t element_idx = obi_column_get_element_index_from_name(column, element_name);
|
||||
@ -2741,6 +2759,26 @@ index_t obi_get_index_with_elt_name_and_col_p_in_view(Obiview_p view, OBIDMS_col
|
||||
}
|
||||
|
||||
|
||||
int obi_set_index_with_elt_name_and_col_name_in_view(Obiview_p view, const char* column_name, index_t line_nb, const char* element_name, index_t value)
|
||||
{
|
||||
OBIDMS_column_p column_p;
|
||||
column_p = obi_view_get_column(view, column_name);
|
||||
if (column_p == NULL)
|
||||
return -1;
|
||||
return obi_set_index_with_elt_name_and_col_p_in_view(view, column_p, line_nb, element_name, value);
|
||||
}
|
||||
|
||||
|
||||
int obi_set_index_with_elt_idx_and_col_name_in_view(Obiview_p view, const char* column_name, index_t line_nb, index_t element_idx, index_t value)
|
||||
{
|
||||
OBIDMS_column_p column_p;
|
||||
column_p = obi_view_get_column(view, column_name);
|
||||
if (column_p == NULL)
|
||||
return -1;
|
||||
return obi_set_index_with_elt_idx_and_col_p_in_view(view, column_p, line_nb, element_idx, value);
|
||||
}
|
||||
|
||||
|
||||
index_t obi_get_index_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;
|
||||
|
Reference in New Issue
Block a user