#include "../../shared/Marshal.h" #include "HistoryDirectory.h" #include "RemoteHistoryResponse.h" namespace RemoteHistoryResponse { static void addType(std::string &message, Type type) { mPush(message, marshal(type)); } void debugMessage(std::string &message) { addType(message, Type::Debug); } std::string gracefulClose() { static const std::string message = [=]() { // No payload, only a type, never changes. std::string temp; addType(temp, Type::Close); return temp; }(); return message; } void dataMessage(std::string &message) { addType(message, Type::Data); } std::string fileNotFound() { std::string result; HistoryDirectory::instance().getServerList().marshal(result); addType(result, Type::FileNotFound); return result; } }