⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 log.h

📁 游戏中我们经常看到的影子效果
💻 H
字号:
//////////////////////////////////////////////////////////////////////////////////////////
//	LOG.h
//	Singleton class declaration for a log file
//	Downloaded from: www.paulsprojects.net
//	Created:	20th July 2002
//	Modified:	8th November 2002	-	Added "Output Misc"
//				18th November 2002	-	Made singleton to provide global access point
//
//	Copyright (c) 2006, Paul Baker
//	Distributed under the New BSD Licence. (See accompanying file License.txt or copy at
//	http://www.paulsprojects.net/NewBSDLicense.txt)
//////////////////////////////////////////////////////////////////////////////////////////	

#ifndef LOG_H
#define LOG_H

#include <stdio.h>

class LOG
{
protected:
	//protected constructor and copy constructor to prevent making copies
	LOG()
	{	Init("Error Log.txt");}
	LOG(const LOG &)
	{}
	LOG & operator= (const LOG &)
	{}

public:
	//public function to access the instance of the log class
	static LOG * Instance()
	{
		//Instance of log class
		static LOG instance;
		return &instance;
	}
	
	bool Init(char * newFilename);

	//Output a new line
	void OutputNewLine();

	//Output messages
	void OutputSuccess(char * text, ...);
	void OutputError(char * text, ...);
	void OutputMisc(char * text, ...);

protected:
	char * filename;
	FILE * logFile;		//pointer to log file, only open when writing
};

#endif

⌨️ 快捷键说明

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