/* * Copyright (c) 2016-2017 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once #include #include #include #include #include #include #include namespace Swift { class Presence; class BOSHError; template std::ostream& operator<<(std::ostream& stream, const std::shared_ptr& ptr) { if (ptr) { stream << *ptr; } else { stream << "nullptr"; } return stream; } template std::ostream& operator<<(std::ostream& stream, const std::vector& vec) { stream << "["; if (!vec.empty()) { auto it = std::begin(vec); stream << *it; ++it; for (auto end = std::end(vec); it != end; ++it) { stream << ", " << *it; } } stream << "]"; return stream; } template std::ostream& operator<<(std::ostream& stream, const std::pair& pair) { stream << pair.first << ":" << pair.second; return stream; } template std::ostream& operator<<(std::ostream& stream, const std::map& map) { stream << "{"; if (!map.empty()) { auto it = std::begin(map); stream << *it; ++it; for (auto end = std::end(map); it != end; ++it) { stream << ", " << *it; } } stream << "}"; return stream; } std::ostream& operator<<(std::ostream& stream, const Presence& presence); std::ostream& operator<<(std::ostream& stream, const BOSHError& boshError); }; ::std::ostream& operator<<(::std::ostream& os, const boost::optional& optStr);