5#ifndef _ZFI_ZFCallerInfo_h_
6#define _ZFI_ZFCallerInfo_h_
27#define ZF_CALLER_FILE_TO_NAME(path) _ZFP_ZF_CALLER_FILE_TO_NAME(path)
31#define ZF_CALLER_FILE_TO_NAME_T(ret, path) _ZFP_ZF_CALLER_FILE_TO_NAME_T(ret, path)
40#define ZF_CALLER_FILE_NAME ZF_CALLER_FILE_TO_NAME(__FILE__)
45#define ZF_CALLER_FILE __FILE__
49#define ZF_CALLER_FUNC __FUNCTION__
53#define ZF_CALLER_FUNC_TRIM _ZFP_ZF_CALLER_FUNC_TRIM(__FUNCTION__)
57#define ZF_CALLER_LINE __LINE__
84 inline operator zfbool (
void)
const {
return this->valid();}
128 const zfchar *_callerFile;
129 const zfchar *_callerFunc;
138 this->_callerFile = callerFile;
139 this->_callerFunc = callerFunc;
140 this->_callerLine = callerLine;
149#define ZFCallerInfoCreate() \
150 ZFCallerInfo()._ZFP_callerInfo(ZF_CALLER_FILE, ZF_CALLER_FUNC_TRIM, ZF_CALLER_LINE)
156#define ZFCallerInfoEmpty() _ZFP_ZFCallerInfoEmpty()
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
_ZFT_t_zfchar zfchar
char wrapper
Definition ZFCoreTypeDef_CharType.h:17
#define zffinal
dummy macro shows that a method or class is designed must not to be overrided
Definition ZFCoreTypeDef_ClassType.h:63
#define zfclassLikePOD
shows the class is not a POD type, but you may use it like a POD except memset it to 0
Definition ZFCoreTypeDef_ClassType.h:41
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:198
#define ZF_IN_OUT
dummy macro that shows the param used as required input and output
Definition ZFCoreTypeDef_ClassType.h:214
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
#define zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:88
_ZFT_t_zfuint zfuint
same as unsigned int, see zfindex
Definition ZFCoreTypeDef_CoreType.h:169
#define ZFOUTPUT_TYPE(T_Type, outputAction)
declare your custom type conversion to string, convenient for debug
Definition ZFCoreTypeDef_OtherType.h:221
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
util class to hold caller info
Definition ZFCallerInfo.h:64
ZFCallerInfo(void)
main constructor
void objectInfoT(zfstring &ret) const
see objectInfo
Definition ZFCallerInfo.h:117
zfbool callerInfoT(zfstring &ret) const
return caller info looks like "[File function (line)]"
zfuint callerLine(void) const
see ZF_CALLER_LINE
Definition ZFCallerInfo.h:93
ZFCallerInfo(const zfchar *callerFile, const zfchar *callerFunc, zfuint callerLine)
main constructor
void callerInfo(const zfchar *callerFile, const zfchar *callerFunc, zfuint callerLine)
set the caller info
zfbool valid(void) const
whether valid
Definition ZFCallerInfo.h:96
const zfchar * callerFunc(void) const
see ZF_CALLER_FUNC
Definition ZFCallerInfo.h:91
zfstring callerInfo(void) const
return caller info looks like "[File function (line)]"
Definition ZFCallerInfo.h:110
const zfchar * callerFile(void) const
see ZF_CALLER_FILE
Definition ZFCallerInfo.h:89
zfstring objectInfo(void) const
return object info
Definition ZFCallerInfo.h:121