Skip to content
Snippets Groups Projects
Commit 322d2ca9 authored by Adam Radziszewski's avatar Adam Radziszewski
Browse files

ann sent rm chan, use with care

parent 9da40d48
Branches
No related merge requests found
PROJECT(Corpus2Library)
set(corpus2_ver_major "1")
set(corpus2_ver_minor "2")
set(corpus2_ver_patch "3")
set(corpus2_ver_minor "3")
set(corpus2_ver_patch "0")
cmake_minimum_required(VERSION 2.8.0)
......
......@@ -125,6 +125,14 @@ public:
return true;
}
/**
* Remove channel having a given name. Returns whether removed
* (will return false if no channel of the given name exists).
*/
bool remove_channel(const std::string& name) {
return (channels_.erase(name) > 0);
}
const chan_map_t& all_channels() const {
return channels_;
}
......
......@@ -50,6 +50,12 @@ namespace Corpus2 {
AnnotationChannel& get_channel(const std::string& name);
const AnnotationChannel& get_channel(const std::string& name) const;
bool add_channel(const std::string& name, const AnnotationChannel& chan);
/* Use with care. Note that get_channel returns a reference to the original
channel, hence it is strongly recommended to del the channel ref object
before attempting to call remove_channel. */
bool remove_channel(const std::string& name);
const chan_map_t& all_channels() const;
/* --------------------------------------------------------------------- */
......
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