Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef LIBWCCL_VALUES_STRSET_H
#define LIBWCCL_VALUES_STRSET_H
#include <libwccl/values/value.h>
#include <boost/unordered_set.hpp>
#include <libcorpus2/lexeme.h> // for unicodestring hash
namespace Wccl {
class StrSet : public Value
{
public:
WCCL_VALUE_PREAMBLE
typedef boost::unordered_set<UnicodeString> set_t;
StrSet()
: set_()
{
}
explicit StrSet(const set_t& s)
: set_(s)
{
}
const set_t& contents() const {
return set_;
}
set_t& contents() {
return set_;
}
void set_contents(const set_t& set) {
set_ = set;
}
void swap(StrSet& ss) {
ss.set_.swap(set_);
}
void insert(const UnicodeString& u) {
set_.insert(u);
}
void insert_utf8(const std::string& u) {
insert(UnicodeString::fromUTF8(u));
}
int size() const {
return set_.size();
}
bool empty() const {
return set_.empty();
}
bool is_subset_of(const StrSet& /*set*/) const {
//TODO: implement this
return false;
}
bool intersects(const StrSet& /*set*/) const {
//TODO: implement this
return false;
}
bool equals(const StrSet& /*set*/) const {
//TODO: implement this
return false;
}