-/*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
-*\r
-* This file is part of CasparCG.\r
-*\r
-* CasparCG is free software: you can redistribute it and/or modify\r
-* it under the terms of the GNU General Public License as published by\r
-* the Free Software Foundation, either version 3 of the License, or\r
-* (at your option) any later version.\r
-*\r
-* CasparCG is distributed in the hope that it will be useful,\r
-* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-* GNU General Public License for more details.\r
-\r
-* You should have received a copy of the GNU General Public License\r
-* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
-*\r
-*/\r
-#pragma once\r
-\r
-#include <memory>\r
-#include <string>\r
-#include <iostream>\r
-\r
-namespace caspar { namespace IO {\r
-\r
-class ClientInfo \r
-{\r
-protected:\r
- ClientInfo(){}\r
-\r
-public:\r
- virtual ~ClientInfo(){}\r
-\r
- virtual void Send(const std::wstring& data) = 0;\r
- virtual void Disconnect() = 0;\r
-\r
- std::wstring currentMessage_;\r
-};\r
-typedef std::shared_ptr<ClientInfo> ClientInfoPtr;\r
-\r
-struct ConsoleClientInfo : public caspar::IO::ClientInfo \r
-{\r
- void Send(const std::wstring& data)\r
- {\r
- std::wcout << (L"\n--------------------\n" + data + L"--------------------\n");\r
- }\r
- void Disconnect(){}\r
-};\r
-\r
-}}\r
+/*
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
+*
+* This file is part of CasparCG (www.casparcg.com).
+*
+* CasparCG is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* CasparCG is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
+*
+* Author: Nicklas P Andersson
+*/
+
+#pragma once
+
+#include <memory>
+#include <string>
+#include <iostream>
+
+#include <common/log.h>
+#include "protocol_strategy.h"
+
+namespace caspar { namespace IO {
+
+typedef spl::shared_ptr<client_connection<wchar_t>> ClientInfoPtr;
+
+struct ConsoleClientInfo : public client_connection<wchar_t>
+{
+ void send(std::wstring&& data) override
+ {
+ std::wcout << (L"#" + caspar::log::replace_nonprintable_copy(data, L'?')) << std::flush;
+ }
+ void disconnect() override {}
+ std::wstring address() const override { return L"Console"; }
+ void add_lifecycle_bound_object(const std::wstring& key, const std::shared_ptr<void>& lifecycle_bound) override {}
+ std::shared_ptr<void> remove_lifecycle_bound_object(const std::wstring& key) override { return std::shared_ptr<void>(); }
+};
+
+}}