void ZFVersionSet(ZF_IN_OUT zfstring &version, ZF_IN zfindex subVersionIndex, ZF_IN const zfchar *subVersion, ZF_IN_OPT const zfchar *emptySubVersion /* = zfText("0") */) { ZFCoreArrayPOD<zfindexRange> pos; if(!version.isEmpty() && zfCoreDataPairSplitString(pos, zfindexMax, version, zfindexMax, '\0', '\0', zfText(".")) != zfnull) { return ; } if(pos.count() <= subVersionIndex) { for(zfindex i = pos.count(); i < subVersionIndex; ++i) { if(i != 0) { version += '.'; } version += emptySubVersion; } version += '.'; version += subVersion; } else { version.replace(pos[subVersionIndex].start, pos[subVersionIndex].count, subVersion); } }
ZF_NAMESPACE_GLOBAL_BEGIN void ZFVersionGet(ZF_OUT zfstring &ret, ZF_IN const zfchar *version, ZF_IN zfindex subVersionIndex) { ZFCoreArrayPOD<zfindexRange> pos; if(*version != '\0' && zfCoreDataPairSplitString(pos, zfindexMax, version, zfindexMax, '\0', '\0', zfText(".")) != zfnull) { return ; } if(pos.count() <= subVersionIndex) { return ; } ret.append(version + pos[subVersionIndex].start, pos[subVersionIndex].count); }
ZFCompareResult ZFStyleableHolder::objectCompare(ZF_IN ZFObject *anotherObj) { if(this == anotherObj) {return ZFCompareTheSame;} zfself *another = ZFCastZFObject(zfself *, anotherObj); if(another == zfnull) {return ZFCompareUncomparable;} ZFCoreArrayPOD<const ZFProperty *> allProperty = ZFClassUtil::allProperty(another->classData()); for(zfindex i = 0; i < allProperty.count(); ++i) { if(this->classData()->classIsTypeOf(allProperty[i]->ownerClass())) { if(allProperty[i]->callbackCompare(allProperty[i], this, another) != ZFCompareTheSame) { return ZFCompareUncomparable; } } } return ZFCompareTheSame; }
void _ZFP_zfCoreCriticalErrorPrepare(ZF_IN const zfcharA *callerFile, ZF_IN const zfcharA *callerFunction, ZF_IN zfindex callerLine) { const ZFCoreArrayPOD<ZFCoreCriticalErrorCallback> &criticalErrorCallbacks = _ZFP_ZFCoreCriticalErrorPrepareCallbacks; for(zfindex i = 0; i < criticalErrorCallbacks.count(); ++i) { criticalErrorCallbacks[i](ZF_CALLER_PATH_TO_NAME(zfsCoreA2Z(callerFile)), zfsCoreA2Z(callerFunction), callerLine); } }
ZFUIView *viewChildAt(ZF_IN ZFUIView *view, ZF_IN const ZFUIPoint &pos, ZF_IN_OPT zfbool filterDisabledView /* = zftrue */, ZF_IN_OPT const ZFFilterForZFObject *filter /* = zfnull */) { if(view == zfnull || (filterDisabledView && !view->viewUIEnableTree()) || (filter != zfnull && !filter->filterCheckActive(view))) { return zfnull; } if(pos.x < 0 || pos.y < 0 || pos.x > view->layoutedFrame().size.width || pos.y > view->layoutedFrame().size.height) { return zfnull; } ZFUIRect layoutedFrameFixed = ZFUIRectZero; ZFCoreArrayPOD<ZFUIView *> childList = view->internalForegroundViewArray(); for(zfindex i = childList.count() - 1; i != zfindexMax; --i) { ZFUIView *child = childList[i]; child->layoutedFrameFixed(layoutedFrameFixed); ZFUIView *tmp = ZFUIViewUtil::viewChildAt(childList[i], ZFUIPointMake( pos.x - layoutedFrameFixed.point.x, pos.y - layoutedFrameFixed.point.y ), filterDisabledView, filter); if(tmp != zfnull) { return tmp; } } childList = view->childArray(); for(zfindex i = childList.count() - 1; i != zfindexMax; --i) { ZFUIView *child = childList[i]; child->layoutedFrameFixed(layoutedFrameFixed); ZFUIView *tmp = ZFUIViewUtil::viewChildAt(childList[i], ZFUIPointMake( pos.x - layoutedFrameFixed.point.x, pos.y - layoutedFrameFixed.point.y ), filter); if(tmp != zfnull) { return tmp; } } childList = view->internalBackgroundViewArray(); for(zfindex i = childList.count() - 1; i != zfindexMax; --i) { ZFUIView *child = childList[i]; child->layoutedFrameFixed(layoutedFrameFixed); ZFUIView *tmp = ZFUIViewUtil::viewChildAt(childList[i], ZFUIPointMake( pos.x - layoutedFrameFixed.point.x, pos.y - layoutedFrameFixed.point.y ), filter); if(tmp != zfnull) { return tmp; } } if(filterDisabledView && !view->viewUIEnable()) { return zfnull; } return view; }