Added functions to get and set values in columns using the element name

(for columns with lines made of vectors of elements), for all data types
This commit is contained in:
Celine Mercier
2015-08-26 15:05:23 +02:00
parent 9d91e907e5
commit 95dbeb25a0
22 changed files with 540 additions and 143 deletions

View File

@ -18,7 +18,7 @@
/**
* @brief Sets a value in an OBIDMS column containing data with the type OBI_CHAR.
* @brief Sets a value in an OBIDMS column containing data with the type OBI_CHAR, using the index of the element in the line.
*
* @param column a pointer as returned by obi_create_column()
* @warning Pointers returned by obi_open_column() don't allow writing.
@ -34,10 +34,10 @@
* @retvalue 0 on success
* @retvalue -1 on failure and the `obi_errno` variable is set.
*
* @since August 2015
* @since July 2015
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
int obi_column_set_char(OBIDMS_column_p column, size_t line_nb, size_t element_idx, obichar_t* value);
int obi_column_set_char_with_elt_idx(OBIDMS_column_p column, size_t line_nb, size_t element_idx, obichar_t* value);
/**
@ -51,9 +51,51 @@ int obi_column_set_char(OBIDMS_column_p column, size_t line_nb, size_t element_i
*
* @return the recovered value
*
* @since July 2015
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
obichar_t* obi_column_get_char_with_elt_idx(OBIDMS_column_p column, size_t line_nb, size_t element_idx);
/**
* @brief Sets a value in an OBIDMS column containing data with the type OBI_CHAR, using the name of the element in the line.
*
* @param column a pointer as returned by obi_create_column()
* @warning Pointers returned by obi_open_column() don't allow writing.
*
* @param line_nb the number of the line where the value should be set
*
* @param element_name the name of the element that should be set in the line
* If empty, it is checked that there is only one element per line
*
* @param value the value that should be set
*
* @return an integer value indicating the success of the operation.
*
* @retvalue 0 on success
* @retvalue -1 on failure and the `obi_errno` variable is set.
*
* @since August 2015
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
obichar_t* obi_column_get_char(OBIDMS_column_p column, size_t line_nb, size_t element_idx);
int obi_column_set_char_with_elt_name(OBIDMS_column_p column, size_t line_nb, char* element_name, obichar_t* value);
/**
* @brief Recovers a value in an OBIDMS column containing data with the type OBI_CHAR, using the name of the element in the line.
*
* @param column a pointer as returned by obi_create_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
* If empty, it is checked that there is only one element per line
*
* @return the recovered value
* @retvalue NULL on failure and the `obi_errno` variable is set. TODO an other value should be chosen maybe
*
* @since August 2015
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
obichar_t* obi_column_get_char_with_elt_name(OBIDMS_column_p column, size_t line_nb, char* element_name);