Added functions to recover the indexes themselves from any column
referring to indexed values
This commit is contained in:
@ -2721,3 +2721,44 @@ const char* obi_get_str_with_elt_name_and_col_name_in_view(Obiview_p view, const
|
||||
|
||||
/****************************************/
|
||||
|
||||
|
||||
/*********** FOR COLUMNS WITH INDEXED VALUES ***********/
|
||||
|
||||
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)
|
||||
return OBIIdx_NA;
|
||||
return obi_column_get_index_with_elt_idx(column, line_nb, element_idx);
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
if (element_idx == OBIIdx_NA)
|
||||
return OBIIdx_NA;
|
||||
return obi_get_index_with_elt_idx_and_col_p_in_view(view, column, line_nb, element_idx);
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
column_p = obi_view_get_column(view, column_name);
|
||||
if (column_p == NULL)
|
||||
return OBIIdx_NA;
|
||||
return obi_get_index_with_elt_idx_and_col_p_in_view(view, column_p, line_nb, element_idx);
|
||||
}
|
||||
|
||||
|
||||
index_t obi_get_index_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 OBIIdx_NA;
|
||||
return obi_get_index_with_elt_name_and_col_p_in_view(view, column_p, line_nb, element_name);
|
||||
}
|
||||
|
||||
/****************************************/
|
||||
|
||||
|
Reference in New Issue
Block a user