Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OBITools3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
23
Issues
23
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
OBITools
OBITools3
Commits
621b4972
Commit
621b4972
authored
Nov 18, 2016
by
Celine Mercier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Functions to get obiblobs through views
parent
7d022c1a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
5 deletions
+88
-5
src/obidmscolumn_blob.c
src/obidmscolumn_blob.c
+3
-3
src/obidmscolumn_blob.h
src/obidmscolumn_blob.h
+2
-2
src/obiview.c
src/obiview.c
+40
-0
src/obiview.h
src/obiview.h
+43
-0
No files found.
src/obidmscolumn_blob.c
View file @
621b4972
...
...
@@ -25,7 +25,7 @@
**********************************************************************/
Obi_blob_p
obi_column_get_
obi
blob_with_elt_idx
(
OBIDMS_column_p
column
,
index_t
line_nb
,
index_t
element_idx
)
Obi_blob_p
obi_column_get_blob_with_elt_idx
(
OBIDMS_column_p
column
,
index_t
line_nb
,
index_t
element_idx
)
{
index_t
idx
;
...
...
@@ -42,12 +42,12 @@ Obi_blob_p obi_column_get_obiblob_with_elt_idx(OBIDMS_column_p column, index_t l
}
Obi_blob_p
obi_column_get_
obi
blob_with_elt_name
(
OBIDMS_column_p
column
,
index_t
line_nb
,
const
char
*
element_name
)
Obi_blob_p
obi_column_get_blob_with_elt_name
(
OBIDMS_column_p
column
,
index_t
line_nb
,
const
char
*
element_name
)
{
index_t
element_idx
=
obi_column_get_element_index_from_name
(
column
,
element_name
);
if
(
element_idx
==
OBIIdx_NA
)
return
OBIBlob_NA
;
return
obi_column_get_
obi
blob_with_elt_idx
(
column
,
line_nb
,
element_idx
);
return
obi_column_get_blob_with_elt_idx
(
column
,
line_nb
,
element_idx
);
}
src/obidmscolumn_blob.h
View file @
621b4972
...
...
@@ -36,7 +36,7 @@
* @since November 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
Obi_blob_p
obi_column_get_
obi
blob_with_elt_idx
(
OBIDMS_column_p
column
,
index_t
line_nb
,
index_t
element_idx
);
Obi_blob_p
obi_column_get_blob_with_elt_idx
(
OBIDMS_column_p
column
,
index_t
line_nb
,
index_t
element_idx
);
/**
...
...
@@ -53,7 +53,7 @@ Obi_blob_p obi_column_get_obiblob_with_elt_idx(OBIDMS_column_p column, index_t l
* @since November 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
Obi_blob_p
obi_column_get_
obi
blob_with_elt_name
(
OBIDMS_column_p
column
,
index_t
line_nb
,
const
char
*
element_name
);
Obi_blob_p
obi_column_get_blob_with_elt_name
(
OBIDMS_column_p
column
,
index_t
line_nb
,
const
char
*
element_name
);
#endif
/* OBIDMSCOLUMN_BLOB_H_ */
...
...
src/obiview.c
View file @
621b4972
...
...
@@ -20,6 +20,7 @@
#include "obidms.h"
#include "obidmscolumn.h"
#include "obidmscolumn_idx.h"
#include "obidmscolumn_blob.h"
#include "obidmscolumn_bool.h"
#include "obidmscolumn_char.h"
#include "obidmscolumn_float.h"
...
...
@@ -32,6 +33,7 @@
#include "obilittlebigman.h"
#include "hashtable.h"
#include "utils.h"
#include "obiblob.h"
#define DEBUG_LEVEL 0 // TODO has to be defined somewhere else (cython compil flag?)
...
...
@@ -2000,6 +2002,44 @@ int obi_save_and_close_view(Obiview_p view)
}
/*********** FOR BLOB COLUMNS ***********/
Obi_blob_p
obi_get_blob_with_elt_idx_and_col_p_in_view
(
Obiview_p
view
,
OBIDMS_column_p
column_p
,
index_t
line_nb
,
index_t
element_idx
)
{
if
(
prepare_to_get_value_from_column
(
view
,
&
line_nb
)
<
0
)
return
OBIBlob_NA
;
return
obi_column_get_blob_with_elt_idx
(
column_p
,
line_nb
,
element_idx
);
}
Obi_blob_p
obi_get_blob_with_elt_name_and_col_p_in_view
(
Obiview_p
view
,
OBIDMS_column_p
column_p
,
index_t
line_nb
,
const
char
*
element_name
)
{
index_t
element_idx
=
obi_column_get_element_index_from_name
(
column_p
,
element_name
);
if
(
element_idx
==
OBIIdx_NA
)
return
OBIBlob_NA
;
return
obi_get_blob_with_elt_idx_and_col_p_in_view
(
view
,
column_p
,
line_nb
,
element_idx
);
}
Obi_blob_p
obi_get_blob_with_elt_idx_and_col_name_in_view
(
Obiview_p
view
,
const
char
*
column_name
,
index_t
line_nb
,
index_t
element_idx
)
{
OBIDMS_column_p
column_p
;
column_p
=
obi_view_get_column
(
view
,
column_name
);
if
(
column_p
==
NULL
)
return
OBIBlob_NA
;
return
obi_get_blob_with_elt_idx_and_col_p_in_view
(
view
,
column_p
,
line_nb
,
element_idx
);
}
Obi_blob_p
obi_get_blob_with_elt_name_and_col_name_in_view
(
Obiview_p
view
,
const
char
*
column_name
,
index_t
line_nb
,
const
char
*
element_name
)
{
OBIDMS_column_p
column_p
;
column_p
=
obi_view_get_column
(
view
,
column_name
);
if
(
column_p
==
NULL
)
return
OBIBlob_NA
;
return
obi_get_blob_with_elt_name_and_col_p_in_view
(
view
,
column_p
,
line_nb
,
element_name
);
}
/*********** FOR BOOL COLUMNS ***********/
int
obi_set_bool_with_elt_idx_and_col_p_in_view
(
Obiview_p
view
,
OBIDMS_column_p
column_p
,
index_t
line_nb
,
index_t
element_idx
,
obibool_t
value
)
...
...
src/obiview.h
View file @
621b4972
...
...
@@ -26,6 +26,7 @@
#include "obidmscolumn.h"
#include "obierrno.h"
#include "hashtable.h"
#include "obiblob.h"
#define OBIVIEW_NAME_MAX_LENGTH (249)
/**< The maximum length of an OBIDMS view name, without the extension.
...
...
@@ -490,6 +491,48 @@ int obi_close_view(Obiview_p view);
int
obi_save_and_close_view
(
Obiview_p
view
);
/**
* @brief Recovers an obiblob from an OBIDMS column containing indices referring to obiblobs, in the context of a view.
*
* @param view A pointer on the opened view.
* @param column_p 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 obiblob.
* @retval OBIBlob_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)
*/
Obi_blob_p
obi_get_blob_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
Obi_blob_p
obi_get_blob_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 an obiblob from an OBIDMS column containing indices referring to obiblobs,
* using the name of the element in the line, in the context of a view.
*
* @param view A pointer on the opened view.
* @param column_p 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 obiblob.
* @retval OBIBlob_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)
*/
Obi_blob_p
obi_get_blob_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
Obi_blob_p
obi_get_blob_with_elt_name_and_col_name_in_view
(
Obiview_p
view
,
const
char
*
column_name
,
index_t
line_nb
,
const
char
*
element_name
);
/**
* @brief Sets a value in an OBIDMS column containing data with the type OBI_BOOL, using the index of the element in the line,
* in the context of a view.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment