www.pudn.com > zfxcengine-0.1.0.zip > ceConsole.cpp


#include "Core/ceConsole.h" 
#include "Core/ceDebug.h" 
 
using namespace std; 
 
namespace ZFXCE 
{ 
	//////////////////////////////////////////////////////////////////////////////// 
	ceConsole::ceConsole() 
	{ 
		PUSH_FUNCTION; 
 
		// empty 
	} 
	//////////////////////////////////////////////////////////////////////////////// 
	ceConsole::~ceConsole() 
	{ 
		PUSH_FUNCTION; 
 
		// empty 
	} 
	//////////////////////////////////////////////////////////////////////////////// 
	void ceConsole::AddOutPut(const std::string &strOutput) 
	{ 
		PUSH_FUNCTION; 
 
		ce_assert (0 != strOutput.size()); 
		//m_sOutPut.push_back(strOutput); 
		cout << strOutput << endl; 
	} 
	//////////////////////////////////////////////////////////////////////////////// 
	void ceConsole::OutrErr(const std::string &strError) 
	{ 
		PUSH_FUNCTION; 
 
		ce_assert (strError.size() != 0); 
		//m_strErr.push_back(strError); 
		cerr << strError << endl; 
	} 
	//////////////////////////////////////////////////////////////////////////////// 
	void ceConsole::Comment(const string &strMsg) 
	{ 
		PUSH_FUNCTION; 
 
		if (0 == strMsg.size()) 
			return; 
		AddOutPut(strMsg); 
	} 
	//////////////////////////////////////////////////////////////////////////////// 
	void ceConsole::Warn(const string &strWarnMsg) 
	{ 
		PUSH_FUNCTION; 
 
		if (0 == strWarnMsg.size()) 
			return; 
 
		const string strWarn = "*WARN*  "+strWarnMsg; 
		m_strErr.push_back(strWarn); 
	} 
	//////////////////////////////////////////////////////////////////////////////// 
	void ceConsole::Error(const string &strErrMsg) 
	{ 
		PUSH_FUNCTION; 
 
		if (0 == strErrMsg.size()) 
			return; 
 
		const string strErr = "*ERR*  " + strErrMsg; 
		//m_strErr.push_back(strErr); 
		std::cerr << strErrMsg << endl; 
	} 
	//////////////////////////////////////////////////////////////////////////////// 
	void ceConsole::FatalError(const string &strErrMsg) 
	{ 
		PUSH_FUNCTION; 
 
		if (0 == strErrMsg.size()) 
			return; 
		const string strErr = "*FATAL*"+strErrMsg; 
		//m_strErr.push_back(strErr); 
		std::cerr << strErrMsg << endl; 
	} 
} // Namespace ZFXCE