Added functions to recover the indexes themselves from any column

referring to indexed values
This commit is contained in:
Celine Mercier
2016-11-28 11:35:19 +01:00
parent d40d2d0c76
commit 3e53f9418b
4 changed files with 144 additions and 0 deletions

View File

@ -1314,4 +1314,53 @@ const char* obi_get_str_with_elt_name_and_col_p_in_view(Obiview_p view, OBIDMS_c
const char* obi_get_str_with_elt_name_and_col_name_in_view(Obiview_p view, const char* column_name, index_t line_nb, const char* element_name);
/**
* @brief Recovers a value in an OBIDMS column containing indexes, in the context of a view.
*
* This enables to recover the indexes in columns containing any type of indexed data (OBI_SEQ, OBI_STR...), for example to quickly test if
* the values are identical (same index in the same indexer).
*
* @param view A pointer on the opened view.
* @param column A pointer on the column.
* @param line_nb The number of the line where the value should be recovered.
* @param element_idx The index of the element that should be recovered in the line.
*
* @returns The recovered value.
* @retval OBIIdx_NA the NA value of the type if an error occurred and obi_errno is set.
*
* @since November 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
index_t obi_get_index_with_elt_idx_and_col_p_in_view(Obiview_p view, OBIDMS_column_p column_p, index_t line_nb, index_t element_idx);
// TODO
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);
/**
* @brief Recovers a value in an OBIDMS column containing indexes,
* using the name of the element in the line, in the context of a view.
*
* This enables to recover the indexes in columns containing any type of indexed data (OBI_SEQ, OBI_STR...), for example to quickly test if
* the values are identical (same index in the same indexer).
*
* @param view A pointer on the opened view.
* @param column A pointer on the column.
* @param line_nb The number of the line where the value should be recovered.
* @param element_name The name of the element that should be recovered in the line.
*
* @returns The recovered value.
* @retval OBIIdx_NA the NA value of the type if an error occurred and obi_errno is set.
*
* @since November 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
index_t obi_get_index_with_elt_name_and_col_p_in_view(Obiview_p view, OBIDMS_column_p column_p, index_t line_nb, const char* element_name);
// TODO
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);
#endif /* OBIVIEW_H_ */