From c91b44b02f658548bdc70a625eb54d0ea86f6737 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Mon, 8 Feb 2016 14:20:34 -0800 Subject: Add binary for smoke-testing offline downloads --- src/mbgl/storage/response.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/mbgl/storage') diff --git a/src/mbgl/storage/response.cpp b/src/mbgl/storage/response.cpp index 09c43c8a6a..644d73d286 100644 --- a/src/mbgl/storage/response.cpp +++ b/src/mbgl/storage/response.cpp @@ -1,6 +1,9 @@ #include #include +#include +#include + namespace mbgl { Response::Response(const Response& res) { @@ -22,4 +25,23 @@ Response::Error::Error(Reason reason_, const std::string& message_) : reason(reason_), message(message_) { } +std::ostream& operator<<(std::ostream& os, Response::Error::Reason r) { + switch (r) { + case Response::Error::Reason::Success: + return os << "Response::Error::Reason::NotFound"; + case Response::Error::Reason::NotFound: + return os << "Response::Error::Reason::NotFound"; + case Response::Error::Reason::Server: + return os << "Response::Error::Reason::Server"; + case Response::Error::Reason::Connection: + return os << "Response::Error::Reason::Connection"; + case Response::Error::Reason::Other: + return os << "Response::Error::Reason::Other"; + } + + // The above switch is exhaustive, but placate GCC nonetheless: + assert(false); + return os; +} + } // namespace mbgl -- cgit v1.2.1