utility.h

来自「Recite(一个辅助英语学习软件源码) 该程序的UI部分使用了WTL7.5。」· C头文件 代码 · 共 42 行

H
42
字号
//PK 2006/07/24 - 10/18
#pragma once

#include <string>
using std::string;
using std::wstring;
#include <stack>
using std::stack;
#include <ctime>

wstring c2w(const string & txt);
string w2c(const wstring & txt);

string ulong2c(const unsigned long l);
wstring ulong2w(const unsigned long l);

wstring time2w(const unsigned int seconds);

class CRandom
{
public:
	CRandom();
	int get_number(int low, int up);
};

template <class T>
void
clear_stack(stack<T> & container)
{	//PK 2006/08/16
	while (!container.empty()) {
		delete container.top();
		container.pop();
	}
}

template <typename TRETURN>
TRETURN * 
move_point(void * p, int offset)
{	//PK 2006/08/29 - 30
	return reinterpret_cast<TRETURN *>(reinterpret_cast<char *>(p) + offset);
}

⌨️ 快捷键说明

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