*/
DeclException2(ExcNoMatch,
std::string,
- const Patterns::PatternBase *,
+ std::string,
<< "The string " << arg1 << " does not match the pattern \""
- << arg2->description() << "\"");
+ << arg2 << "\"");
//@}
} // namespace Tools
} // namespace Patterns
str << (static_cast<bool>(value) ? "true" : "false");
else
str << value;
- AssertThrow(p->match(str.str()), ExcNoMatch(str.str(), p.get()));
+ AssertThrow(p->match(str.str()),
+ ExcNoMatch(str.str(), p->description()));
return str.str();
}
const std::unique_ptr<Patterns::PatternBase> &p =
Convert<T>::to_pattern())
{
- AssertThrow(p->match(s), ExcNoMatch(s, p.get()));
+ AssertThrow(p->match(s), ExcNoMatch(s, p->description()));
T value;
if (std::is_same<T, bool>::value)
value = (s == "true");
for (unsigned int i = 1; i < vec.size(); ++i)
s += p->get_separator() + " " + vec[i];
- AssertThrow(pattern->match(s), ExcNoMatch(s, p));
+ AssertThrow(pattern->match(s), ExcNoMatch(s, p->description()));
return s;
}
const std::unique_ptr<Patterns::PatternBase> &pattern =
Convert<T>::to_pattern())
{
- AssertThrow(pattern->match(s), ExcNoMatch(s, pattern.get()));
+ AssertThrow(pattern->match(s), ExcNoMatch(s, pattern->description()));
auto p = dynamic_cast<const Patterns::List *>(pattern.get());
AssertThrow(p,
for (unsigned int i = 1; i < vec.size(); ++i)
s += p->get_separator() + " " + vec[i];
- AssertThrow(p->match(s), ExcNoMatch(s, p));
+ AssertThrow(p->match(s), ExcNoMatch(s, p->description()));
return s;
}
const std::unique_ptr<Patterns::PatternBase> &pattern =
Convert<T>::to_pattern())
{
- AssertThrow(pattern->match(s), ExcNoMatch(s, pattern.get()));
+ AssertThrow(pattern->match(s), ExcNoMatch(s, pattern->description()));
auto p = dynamic_cast<const Patterns::Map *>(pattern.get());
AssertThrow(p,
for (unsigned int i = 1; i < vec.size(); ++i)
s += p->get_separator() + " " + vec[i];
- AssertThrow(p->match(s), ExcNoMatch(s, p));
+ AssertThrow(p->match(s), ExcNoMatch(s, p->description()));
return s;
}
const std::unique_ptr<Patterns::PatternBase> &pattern =
Convert<T>::to_pattern())
{
- AssertThrow(pattern->match(s), ExcNoMatch(s, pattern.get()));
+ AssertThrow(pattern->match(s), ExcNoMatch(s, pattern->description()));
auto p = dynamic_cast<const Patterns::List *>(pattern.get());
AssertThrow(p,
for (unsigned int i = 1; i < expressions.size(); ++i)
s = s + p->get_separator() + expressions[i];
- AssertThrow(pattern->match(s), ExcNoMatch(s, p));
+ AssertThrow(pattern->match(s), ExcNoMatch(s, p->description()));
return s;
}
const std::unique_ptr<Patterns::PatternBase> &pattern =
Convert<T>::to_pattern())
{
- AssertThrow(pattern->match(s), ExcNoMatch(s, pattern.get()));
+ AssertThrow(pattern->match(s), ExcNoMatch(s, pattern->description()));
auto p = dynamic_cast<const Patterns::List *>(pattern.get());
AssertThrow(p,
p->get_separator() + " " +
Convert<typename T::value_type>::to_string(t.imag(), base_p);
- AssertThrow(pattern->match(s), ExcNoMatch(s, p));
+ AssertThrow(pattern->match(s), ExcNoMatch(s, p->description()));
return s;
}
const std::unique_ptr<Patterns::PatternBase> &pattern =
Convert<T>::to_pattern())
{
- AssertThrow(pattern->match(s), ExcNoMatch(s, pattern.get()));
+ AssertThrow(pattern->match(s), ExcNoMatch(s, pattern->description()));
auto p = dynamic_cast<const Patterns::List *>(pattern.get());
AssertThrow(p,
const std::unique_ptr<Patterns::PatternBase> &pattern =
Convert<T>::to_pattern())
{
- AssertThrow(pattern->match(t), ExcNoMatch(t, pattern.get()));
+ AssertThrow(pattern->match(t), ExcNoMatch(t, pattern->description()));
return t;
}
const std::unique_ptr<Patterns::PatternBase> &pattern =
Convert<T>::to_pattern())
{
- AssertThrow(pattern->match(s), ExcNoMatch(s, pattern.get()));
+ AssertThrow(pattern->match(s), ExcNoMatch(s, pattern->description()));
return s;
}
};
std::unordered_map<Key, Value> m;
m.insert(t);
std::string s = Convert<decltype(m)>::to_string(m, pattern);
- AssertThrow(pattern->match(s), ExcNoMatch(s, pattern.get()));
+ AssertThrow(pattern->match(s), ExcNoMatch(s, pattern->description()));
return s;
}
std::string str;
for (unsigned int i = 0; i < string_array.size(); ++i)
str += (i ? " " + p->get_separator() + " " : "") + string_array[i];
- AssertThrow(p->match(str), ExcNoMatch(str, p));
+ AssertThrow(p->match(str), ExcNoMatch(str, p->description()));
return str;
}
const std::unique_ptr<Patterns::PatternBase> &pattern =
Convert<T>::to_pattern())
{
- AssertThrow(pattern->match(s), ExcNoMatch(s, pattern.get()));
+ AssertThrow(pattern->match(s), ExcNoMatch(s, pattern->description()));
auto p = dynamic_cast<const Patterns::Tuple *>(pattern.get());
AssertThrow(p,