📄 util.h
字号:
// Util1.h: interface for the Util class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_UTIL1_H__FE8BB762_E7BD_4A99_B304_70D7EA53DA47__INCLUDED_)
#define AFX_UTIL1_H__FE8BB762_E7BD_4A99_B304_70D7EA53DA47__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <stdio.h>
#include <stdlib.h>
//#include <local.h>
#include "config.h"
#include <string>
using namespace std;
/*
template<typename T, bool flag> struct ReferenceSelector {
typedef T ResultType;
};
template<typename T> struct ReferenceSelector<T,true> {
typedef const T& ResultType;
};
template<typename T> class IsOfClassType {
public:
template<typename U> static char check(int U::*);
template<typename U> static float check(...);
public:
enum { Result = sizeof(check<T>(0)) };
};
template<typename T> struct TypeTraits {
typedef IsOfClassType<T> ClassType;
typedef ReferenceSelector<T, ((ClassType::Result == 1) || (sizeof(T) > sizeof(char*)) ) > Selector;
typedef typename Selector::ResultType ParameterType;
};
#define GETSET(type, name, name2) \
private: type name; \
public: TypeTraits<type>::ParameterType get##name2() const { return name; } \
void set##name2(TypeTraits<type>::ParameterType a##name2) { name = a##name2; }
*/
class Util
{
public:
static string emptyString;
Util();
~Util();
static int64_t toInt64(const string& aString);
static int toInt(const string& aString);
static u_int32_t toUInt32(const string& str);
static u_int32_t toUInt32(const char* c);
static string toString(short val);
static string toString(unsigned short val);
static string toString(int val);
static string toString(unsigned int val);
static string toString(long val);
static string toString(unsigned long val);
#if defined(_MSC_VER) && (_MSC_VER!=1200)
static string toString(long long val);
static string toString(unsigned long long val);
#endif
static string toString(double val);
};
#endif // !defined(AFX_UTIL1_H__FE8BB762_E7BD_4A99_B304_70D7EA53DA47__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -