utility.hpp

来自「一个开放源代码的AVR单片机编程器」· HPP 代码 · 共 71 行

HPP
71
字号
/*****************************************************************************
 *
 * Atmel Corporation
 *
 * File              : Utility.hpp
 * Compiler          : Dev-C++ 4.9.8.0 - http://bloodshed.net/dev/
 * Revision          : $Revision: 3.0 $
 * Date              : $Date: Tuesday, January 17, 2006 18:33:56 UTC $
 * Updated by        : $Author: raapeland $
 *
 * Support mail      : avr@atmel.com
 *
 * Target platform   : Win32
 *
 * AppNote           : AVR911 - AVR Open-source Programmer
 *
 * Description       : A class holding misc. utility methods used in AVROSP.
 *
 * 
 ****************************************************************************/
#ifndef UTILITY_HPP
#define UTILITY_HPP

using namespace std;

#ifndef NOREGISTRY
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif

#include <vector>
#include <string>
#include "ErrorMsg.hpp"

class Utility
{
	protected:
		bool noLog;
		bool noProgress;

	public:
		/* Constructor */
		Utility();

		/* Destructor */
		~Utility();

		/* Methods */
		void muteLog() { noLog = true; }
		void muteProgress() { noProgress = true; }

		void log( const string & txt );
		void progress( const string & txt );

		long convertHex( const string & txt );
		string convertLong( long num, long radix = 10 );

		void parsePath( vector<string> & list );
		bool fileExists( string filename );
		void saveString( string txt, string filename );

#ifndef NOREGISTRY	
		string getRegistryValue( const string & path, const string & value );
#endif
};

extern Utility Util;

#endif

⌨️ 快捷键说明

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