diff options
author | Matthew Newhook <matthew@zeroc.com> | 2015-03-18 12:58:16 -0230 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2015-03-18 12:58:16 -0230 |
commit | 9b7668c7c92cf9cb311fe444cdddb489cd2a219d (patch) | |
tree | 5016567c58c81f5654e9d01935e199c6bf4761d2 /cpp/demo/Ice/MFC/server/LogI.cpp | |
parent | VS add-in & build updates: (diff) | |
download | ice-9b7668c7c92cf9cb311fe444cdddb489cd2a219d.tar.bz2 ice-9b7668c7c92cf9cb311fe444cdddb489cd2a219d.tar.xz ice-9b7668c7c92cf9cb311fe444cdddb489cd2a219d.zip |
Removed demos.
Moved demoscript to distribution.
Diffstat (limited to 'cpp/demo/Ice/MFC/server/LogI.cpp')
-rw-r--r-- | cpp/demo/Ice/MFC/server/LogI.cpp | 110 |
1 files changed, 0 insertions, 110 deletions
diff --git a/cpp/demo/Ice/MFC/server/LogI.cpp b/cpp/demo/Ice/MFC/server/LogI.cpp deleted file mode 100644 index 4754fdbff54..00000000000 --- a/cpp/demo/Ice/MFC/server/LogI.cpp +++ /dev/null @@ -1,110 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <stdafx.h> -#include <LogI.h> - -using namespace std; - -LogI::LogI() : - _hwnd(0) -{ -} - -void -LogI::print(const string& msg) -{ - string s = msg; - - string::size_type idx = 0; - while((idx = s.find("\n", idx)) != string::npos) - { - s.replace(idx, 1, "\r\n "); - idx += 3; - } - - message(s); -} - -void -LogI::trace(const string& category, const string& msg) -{ - string s = "[ " + category + ": " + msg + " ]"; - - string::size_type idx = 0; - while((idx = s.find("\n", idx)) != string::npos) - { - s.replace(idx, 1, "\r\n "); - idx += 3; - } - - message(s); -} - -void -LogI::warning(const string& msg) -{ - message("warning: " + msg); -} - -void -LogI::error(const string& msg) -{ - message("error: " + msg); -} - -string -LogI::getPrefix() -{ - return ""; -} - -Ice::LoggerPtr -LogI::cloneWithPrefix(const string&) -{ - return this; -} - -void -LogI::message(const string& msg) -{ - string line = msg + "\r\n"; - if(_hwnd) - { - post(line); - } - else - { - _buffer.append(line); - } -} - -void -LogI::setHandle(HWND hwnd) -{ - _hwnd = hwnd; - if(_hwnd != 0 && !_buffer.empty()) - { - post(_buffer); - _buffer.clear(); - } -} - -void -LogI::post(const string& data) -{ - assert(_hwnd != 0); - char* text = new char[data.size()+1]; -#ifdef _WIN32 - strcpy_s(text, data.size() + 1, data.c_str()); -#else - strcpy(text, data.c_str()); -#endif - ::PostMessage(_hwnd, WM_USER, (WPARAM)FALSE, (LPARAM)text); -} |