obidmscolumn_bool.h 3.59 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
/****************************************************************************
 * OBIDMS_column_bool header file                                            *
 ****************************************************************************/

/**
 * @file obidsmcolumn_bool.h
 * @author Celine Mercier
 * @date August 10th 2015
 * @brief Header file for the functions handling OBIColumns containing data with the OBIType OBI_BOOL.
 */


13 14 15 16
#ifndef OBIDMSCOLUMN_BOOL_H_
#define OBIDMSCOLUMN_BOOL_H_


17 18 19 20 21 22 23 24
#include <stdlib.h>
#include <stdio.h>

#include "obidmscolumn.h"
#include "obitypes.h"


/**
25
 * @brief Sets a value in an OBIDMS column containing data with the type OBI_BOOL, using the index of the element in the line.
26 27 28
 *
 * @warning Pointers returned by obi_open_column() don't allow writing.
 *
29 30 31 32
 * @param column A pointer as returned by obi_create_column() or obi_clone_column().
 * @param line_nb The number of the line where the value should be set.
 * @param element_idx The index of the element that should be set in the line.
 * @param value The value that should be set.
33
 *
34
 * @returns An integer value indicating the success of the operation.
35 36
 * @retval 0 on success.
 * @retval -1 if an error occurred.
37
 *
38
 * @since July 2015
39 40
 * @author Celine Mercier (celine.mercier@metabarcoding.org)
 */
Celine Mercier committed
41
int obi_column_set_obibool_with_elt_idx(OBIDMS_column_p column, index_t line_nb, index_t element_idx, obibool_t value);
42 43 44 45 46


/**
 * @brief Recovers a value in an OBIDMS column containing data with the type OBI_BOOL.
 *
47 48 49
 * @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_idx The index of the element that should be recovered in the line.
50
 *
51 52
 * @returns The recovered value.
 * @retval OBIBool_NA the NA value of the type if an error occurred and obi_errno is set.
53
 *
54 55 56
 * @since July 2015
 * @author Celine Mercier (celine.mercier@metabarcoding.org)
 */
Celine Mercier committed
57
obibool_t obi_column_get_obibool_with_elt_idx(OBIDMS_column_p column, index_t line_nb, index_t element_idx);
58 59 60


/**
61 62
 * @brief Sets a value in an OBIDMS column containing data with the type OBI_BOOL,
 *        using the name of the element in the line.
63 64 65
 *
 * @warning Pointers returned by obi_open_column() don't allow writing.
 *
66 67 68 69
 * @param column A pointer as returned by obi_create_column() or obi_clone_column().
 * @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.
 * @param value The value that should be set.
70
 *
71 72
 * @returns An integer value indicating the success of the operation.
 * @retval 0 on success.
73
 * @retval -1 if an error occurred.
74
 *
75 76 77
 * @since August 2015
 * @author Celine Mercier (celine.mercier@metabarcoding.org)
 */
78
int obi_column_set_obibool_with_elt_name(OBIDMS_column_p column, index_t line_nb, const char* element_name, obibool_t value);
79

80

81
/**
82 83
 * @brief Recovers a value in an OBIDMS column containing data with the type OBI_BOOL,
 *        using the name of the element in the line.
84
 *
85 86 87
 * @param column A pointer as returned by obi_create_column() or obi_clone_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.
88
 *
89 90
 * @returns The recovered value.
 * @retval OBIBool_NA the NA value of the type if an error occurred and obi_errno is set.
91 92 93 94
 *
 * @since August 2015
 * @author Celine Mercier (celine.mercier@metabarcoding.org)
 */
95
obibool_t obi_column_get_obibool_with_elt_name(OBIDMS_column_p column, index_t line_nb, const char* element_name);
96 97 98


#endif /* OBIDMSCOLUMN_BOOL_H_ */
99