36 if (lowerBound ==
end())
39 if (lowerBound->second)
42 return lowerBound->first == comp;
52 m_exclude.insert(std::make_pair(comp,
false));
89 throw Error(
"Invalid exclude range [" +
92 "] (for single name exclude use Exclude::excludeOne)");
95 iterator newFrom = m_exclude.lower_bound(from);
96 if (newFrom ==
end() || !newFrom->second ) {
97 std::pair<iterator, bool> fromResult = m_exclude.insert(std::make_pair(from,
true));
98 newFrom = fromResult.first;
99 if (!fromResult.second) {
101 newFrom->second =
true;
107 iterator newTo = m_exclude.lower_bound(to);
108 if (newTo == newFrom || !newTo->second) {
109 std::pair<iterator, bool> toResult = m_exclude.insert(std::make_pair(to,
false));
110 newTo = toResult.first;
116 m_exclude.erase(newTo, newFrom);
124 iterator newFrom = m_exclude.lower_bound(from);
125 if (newFrom ==
end() || !newFrom->second ) {
126 std::pair<iterator, bool> fromResult = m_exclude.insert(std::make_pair(from,
true));
127 newFrom = fromResult.first;
128 if (!fromResult.second) {
130 newFrom->second =
true;
136 if (newFrom != m_exclude.begin()) {
138 m_exclude.erase(m_exclude.begin(), newFrom);
150 if (!i->first.empty()) {
151 if (!empty) os <<
",";
152 os << i->first.toEscapedString();
156 if (!empty) os <<
",";
const_reverse_iterator rend() const
Get end iterator of the exclude terms.
void toEscapedString(std::ostream &result) const
Write the value to result, escaping characters according to the NDN URI Scheme.
exclude_type::const_iterator const_iterator
Exclude()
Default constructor an empty exclude.
Exclude & excludeOne(const name::Component &comp)
Exclude specific name component.
bool isExcluded(const name::Component &comp) const
Check if name component is excluded.
Component holds a read-only name component value.
exclude_type::iterator iterator
exclude_type::const_reverse_iterator const_reverse_iterator
Exclude & excludeAfter(const name::Component &from)
Exclude all components from range [from, +Inf].
Exclude & excludeRange(const name::Component &from, const name::Component &to)
Exclude components from range [from, to].
const_reverse_iterator rbegin() const
Get begin iterator of the exclude terms.
const_iterator end() const
Get end iterator of the exclude terms.
std::ostream & operator<<(std::ostream &os, const Data &data)
Class to represent Exclude component in NDN interests.