toolsreportstdout.cpp

来自「C++ image processing.Mainly it occupies 」· C++ 代码 · 共 49 行

CPP
49
字号
/* 

This "SOFTWARE" is a free software.

You are allowed to download, use, modify and redistribute this software.
The software is provided "AS IS" without warranty of any kind.

Copyright: University of Koblenz-Landau, Dirk Balthasar

*/

#include "ToolsReport.h"

#include <stdio.h>
#include <iostream>


/// CMessageHandler rediction to std output
class CMessageHandlerPrintf : public tools::CMessageHandler
{
public:
	CMessageHandlerPrintf()
	{
	}
	virtual void LogMessage(const char *msg)
	{
		std::cout << msg << std::endl;
		//printf("%s\n",msg);

		// 
		//int len = strlen(msg);
		//printf("len %d\n",len);
		//for (int i = 0; i < len; i++)
		//	std::cout << msg[i];
		//std::cout << std::endl;
	}
};


// static CMessageHandler * g_MsgHandler = NULL; (moved to cmyk_connect.cpp)
tools::CMessageHandler *tools::CMessageHandler::Get()
{
	if(m_MsgHandler == NULL) {
		tools::CMessageHandler::SetMessageHandler(new CMessageHandlerPrintf());
	}
	return m_MsgHandler;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?