Views: Added argument to not automatically create default columns in

typed views, a function to delete a view and fixed view history bug
This commit is contained in:
Celine Mercier
2018-10-31 14:38:05 +01:00
parent 92c0fbc9bf
commit 320561a582
6 changed files with 171 additions and 15 deletions

View File

@ -203,6 +203,7 @@ Obiview_p obi_new_view_cloned_from_name(OBIDMS_p dms, const char* view_name, con
* if there is one. NULL if there is no line selection or no view to clone.
* @param comments Eventually, comments to associate with the view. NULL if not.
* @param quality_column Whether or not a sequence quality column is associated with the view.
* @param create_default_columns Whether to create the default columns associated with the view type (false when importing all columns from a view for example).
*
* @returns A pointer to the newly created view structure.
* @retval NULL if an error occurred.
@ -210,7 +211,7 @@ Obiview_p obi_new_view_cloned_from_name(OBIDMS_p dms, const char* view_name, con
* @since February 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
Obiview_p obi_new_view_nuc_seqs(OBIDMS_p dms, const char* view_name, Obiview_p view_to_clone, index_t* line_selection, const char* comments, bool quality_column);
Obiview_p obi_new_view_nuc_seqs(OBIDMS_p dms, const char* view_name, Obiview_p view_to_clone, index_t* line_selection, const char* comments, bool quality_column, bool create_default_columns);
/**
@ -579,6 +580,29 @@ int obi_clean_unfinished_views(OBIDMS_p dms);
int obi_rollback_view(Obiview_p view);
/**
* @brief Deletes a finished view file.
*
* Only the view informations file is deleted.
* This function should only be used to delete 'temporary views' not meant to appear in the DMS history.
*
* @warning The view needs to be closed. The function checks that the view exists and is finished, but not that it is closed.
* If it was not closed, memory errors will be generated when the system tries to read the deleted file.
* // TODO maybe take opened view as argument in order to close it? but doesn't guarantee that it isn't open elsewhere.
*
* @param dms A pointer on the DMS to which the view belongs.
* @param view_name The name of the view to delete.
*
* @returns A value indicating the success of the operation.
* @retval 0 if the operation was successfully completed.
* @retval -1 if an error occurred.
*
* @since October 2018
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
int obi_delete_view(OBIDMS_p dms, const char* view_name);
/**
* @brief Creates an OBI_INT column with the line count of the view it belongs to, and sets all lines to 1.
*