obidmscolumn_str.h 7.13 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
#include <stdlib.h>
#include <stdio.h>

#include "obidmscolumn.h"
#include "obitypes.h"
Celine Mercier committed
22
#include "obiview.h"
23 24 25


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


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


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

83

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


Celine Mercier committed
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
/**
 * @brief Sets a value in an OBIDMS column containing data in the form of indices referring
 * to character strings in an AVL tree, using the index of the element in the line.
 *
 * @warning Pointers returned by obi_open_column() don't allow writing.
 *
 * @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.
 *
 * @returns An integer value indicating the success of the operation.
 * @retval 0 on success.
 * @retval -1 if an error occurred.
 *
 * @since February 2016
 * @author Celine Mercier (celine.mercier@metabarcoding.org)
 */
int obi_column_set_obistr_with_elt_idx_in_view(Obiview_p view, OBIDMS_column_p column, index_t line_nb, index_t element_idx, char* value);


/**
 * @brief Recovers a value in an OBIDMS column containing data in the form of indices referring
 * to character strings in an AVL tree, using the index 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_idx The index of the element that should be recovered in the line.
 *
 * @returns The recovered value.
 * @retval '\0' the NA value of the type if an error occurred and obi_errno is set.
 *
 * @since February 2016
 * @author Celine Mercier (celine.mercier@metabarcoding.org)
 */
const char* obi_column_get_obistr_with_elt_idx_in_view(Obiview_p view, OBIDMS_column_p column, index_t line_nb, index_t element_idx);


/**
 * @brief Sets a value in an OBIDMS column containing data in the form of indices referring
 * to character strings in an AVL tree, using the name of the element in the line.
 *
 * @warning Pointers returned by obi_open_column() don't allow writing.
 *
 * @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.
 *
 * @returns An integer value indicating the success of the operation.
 * @retval 0 on success.
 * @retval -1 if an error occurred.
 *
 * @since February 2016
 * @author Celine Mercier (celine.mercier@metabarcoding.org)
 */
int obi_column_set_obistr_with_elt_name_in_view(Obiview_p view, OBIDMS_column_p column, index_t line_nb, const char* element_name, char* value);


/**
 * @brief Recovers a value in an OBIDMS column containing data in the form of indices referring
 * to character strings in an AVL tree, using the name of the element in the line.
 *
 * @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.
 *
 * @returns The recovered value.
 * @retval '\0' the NA value of the type if an error occurred and obi_errno is set.
 *
 * @since February 2016
 * @author Celine Mercier (celine.mercier@metabarcoding.org)
 */
const char* obi_column_get_obistr_with_elt_name_in_view(Obiview_p view, OBIDMS_column_p column, index_t line_nb, const char* element_name);


177
#endif /* OBIDMSCOLUMN_STR_H_ */
178