Commit 86bb582a by Celine Mercier

Views: implemented handling of JSON formatted comments

parent bc8c3940
......@@ -59,6 +59,8 @@
*/
#define ID_PREFIX "seq" /**< The default prefix of sequence identifiers in automatic ID columns.
*/
#define PREDICATE_KEY "predicates" /**< The key used in the json-formatted view comments to store predicates.
*/
/**
......@@ -485,6 +487,44 @@ int obi_view_create_column_alias(Obiview_p view, const char* current_name, const
/**
* @brief Internal function writing new comments in a view file.
*
* The new comments replace the pre-existing ones.
* The view file is enlarged if necessary.
*
* @param view A pointer on the view.
* @param comments The new comments that should be written.
*
* @retval 0 if the operation was successfully completed.
* @retval -1 if an error occurred.
*
* @since August 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
int obi_view_write_comments(Obiview_p view, const char* comments);
/**
* @brief Adds comments to a view file.
*
* This reads the comments in the JSON format and adds the key value pair.
* If the key already exists, the value format is turned into an array and the new value is appended
* if it is not already in the array.
*
* @param column A pointer on an OBIDMS column.
* @param key The key.
* @param value The value associated with the key.
*
* @retval 0 if the operation was successfully completed.
* @retval -1 if an error occurred.
*
* @since August 2018
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
int obi_view_add_comment(Obiview_p view, const char* key, const char* value);
/**
* @brief Closes an opened view, and saves it if it is not read-only (meaning it is not already saved in the view file).
*
* The predicates associated with the view are checked before saving it, and -1 is returned if at
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment