#ifndef BANDIT_MATCHER_H #define BANDIT_MATCHER_H #include //#import "CedarStringifiers.h" namespace bandit { namespace Matchers { class Matcher { public: Matcher() {} template std::string failure_message(const U& value, bool negate) const { std::ostringstream ss; ss << "Expected <" << value << "> " << (negate ? "to not " : "to ") << failure_message_end(); return ss.str(); } std::string failure_message(char *const value, bool negate) const { return failure_message((value ? value : "NULL"), negate); } template std::string failure_message(const std::unique_ptr& value, bool negate) const { return failure_message(value.get(), negate); } std::string failure_message(const std::nullptr_t pointer, bool negate) const { (void)pointer; return failure_message("nullptr", negate); } template std::string failure_message(std::function& value, bool negate) const { return failure_message(typeid(value).name(), negate); } template std::string failure_message(const std::function& value, bool negate) const { return failure_message(typeid(value).name(), negate); } template > class container > std::string failure_message(const container& value, bool negate) const { return failure_message(typeid(value).name(), negate); } template, class = std::allocator > class container > std::string failure_message(const container& value, bool negate) const { return failure_message(typeid(value).name(), negate); } template, class = std::allocator> > class container > std::string failure_message(const container& value, bool negate) const { return failure_message(typeid(value).name(), negate); } protected: virtual std::string failure_message_end() const = 0; }; }} #endif // BANDIT_MATCHER_H