New C functions to import a column and a view from a DMS to another DMS

This commit is contained in:
Celine Mercier
2017-08-03 16:33:12 +02:00
parent a3e81930c2
commit 4b86aa67a8
2 changed files with 362 additions and 1 deletions

View File

@ -361,4 +361,46 @@ char* obi_dms_get_full_path(OBIDMS_p dms, const char* path_name);
DIR* opendir_in_dms(OBIDMS_p dms, const char* path_name);
/**
* @brief Imports a column, copying it from a DMS to another DMS, and returns the version of the column in the destination DMS.
*
* The eventual associated indexers are imported too. If an indexer with the same name already exists in the destination DMS,
* they are not merged, the imported indexer is renamed.
*
* @warning The eventual associated column is not imported and needs to be imported separately.
*
* @param dms_path_1 The path to the source DMS (without the '.obidms' extension).
* @param dms_path_2 The path to the destination DMS (without the '.obidms' extension). It is created if it doesn't already exist.
* @param column_name The name of the column to import.
* @param version_number The version of the column to import.
*
* @returns The new version of the column in the destination DMS.
* @retval -1 if an error occurred.
*
* @since August 2017
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
obiversion_t obi_import_column(const char* dms_path_1, const char* dms_path_2, const char* column_name, obiversion_t version_number);
/**
* @brief Imports a view, copying it and all its associated columns from a DMS to another DMS.
*
* All the columns and the eventual associated indexers are imported. If an indexer with the same name already exists in the destination DMS,
* they are not merged, the imported indexer is renamed.
*
* @param dms_path_1 The path to the source DMS (without the '.obidms' extension).
* @param dms_path_2 The path to the destination DMS (without the '.obidms' extension). It is created if it doesn't already exist.
* @param view_name_1 The name of the view to import.
* @param view_name_2 The name of the imported view in the destination DMS.
*
* @retval 0 on success.
* @retval -1 if an error occurred.
*
* @since August 2017
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
int obi_import_view(const char* dms_path_1, const char* dms_path_2, const char* view_name_1, const char* view_name_2);
#endif /* OBIDMS_H_ */