obidmscolumn_str.h 3.87 KB
Newer Older
1
/****************************************************************************
2
 * OBIDMS_column_str header file                                            *
3 4 5
 ****************************************************************************/

/**
6
 * @file obidsmcolumn_str.h
7
 * @author Celine Mercier
8 9
 * @date October 28th 2015
 * @brief Header file for the functions handling OBIColumns containing data in the form of indices referring to character strings.
10 11 12
 */


13 14
#ifndef OBIDMSCOLUMN_STR_H_
#define OBIDMSCOLUMN_STR_H_
15 16


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 in the form of indices referring
Celine Mercier committed
26
 * to character strings handled by an indexer, using the index of the element in the line.
27 28 29
 *
 * @warning Pointers returned by obi_open_column() don't allow writing.
 *
30 31 32 33
 * @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.
34
 *
35
 * @returns An integer value indicating the success of the operation.
36 37
 * @retval 0 on success.
 * @retval -1 if an error occurred.
38
 *
39
 * @since October 2015
40 41
 * @author Celine Mercier (celine.mercier@metabarcoding.org)
 */
42
int obi_column_set_obistr_with_elt_idx(OBIDMS_column_p column, index_t line_nb, index_t element_idx, const char* value);
43 44 45


/**
46
 * @brief Recovers a value in an OBIDMS column containing data in the form of indices referring
Celine Mercier committed
47
 * to character strings handled by an indexer, using the index of the element in the line.
48
 *
49 50 51
 * @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.
52
 *
53
 * @returns The recovered value.
54
 * @retval OBIStr_NA the NA value of the type if an error occurred and obi_errno is set.
55
 *
56
 * @since October 2015
57 58
 * @author Celine Mercier (celine.mercier@metabarcoding.org)
 */
59
const char* obi_column_get_obistr_with_elt_idx(OBIDMS_column_p column, index_t line_nb, index_t element_idx);
60 61 62


/**
63
 * @brief Sets a value in an OBIDMS column containing data in the form of indices referring
Celine Mercier committed
64
 * to character strings handled by an indexer, using the name of the element in the line.
65 66 67
 *
 * @warning Pointers returned by obi_open_column() don't allow writing.
 *
68 69 70 71
 * @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.
72
 *
73 74
 * @returns An integer value indicating the success of the operation.
 * @retval 0 on success.
75
 * @retval -1 if an error occurred.
76
 *
77
 * @since October 2015
78 79
 * @author Celine Mercier (celine.mercier@metabarcoding.org)
 */
80
int obi_column_set_obistr_with_elt_name(OBIDMS_column_p column, index_t line_nb, const char* element_name, const char* value);
81

82

83
/**
84
 * @brief Recovers a value in an OBIDMS column containing data in the form of indices referring
Celine Mercier committed
85
 * to character strings handled by an indexer, using the name of the element in the line.
86
 *
87 88 89
 * @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.
90
 *
91
 * @returns The recovered value.
92
 * @retval OBIStr_NA the NA value of the type if an error occurred and obi_errno is set.
93
 *
94
 * @since October 2015
95 96
 * @author Celine Mercier (celine.mercier@metabarcoding.org)
 */
97
const char* obi_column_get_obistr_with_elt_name(OBIDMS_column_p column, index_t line_nb, const char* element_name);
98 99


100
#endif /* OBIDMSCOLUMN_STR_H_ */
101