本文整理汇总了C++中zfText函数的典型用法代码示例。如果您正苦于以下问题:C++ zfText函数的具体用法?C++ zfText怎么用?C++ zfText使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zfText函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: stackTrace
virtual void stackTrace(ZF_IN_OUT zfstring &ret,
ZF_IN_OPT const zfchar *prefix = zfnull,
ZF_IN_OPT zfindex ignoreLevel = 0,
ZF_IN_OPT zfindex maxLevel = 20)
{
const zfchar *fixedPrefix = ((prefix == zfnull) ? zfText("") : prefix);
if(maxLevel > 200)
{
maxLevel = 200;
}
void **array = (void **)zfmalloc(sizeof(void *) * (maxLevel + 1));
zfindex size = backtrace(array, (int)(maxLevel + 1));
zfcharA **strings = backtrace_symbols(array, (int)size);
ret += fixedPrefix;
ret += zfText("======================== stack begin =======================");
ret += '\n';
for(zfindex i = ignoreLevel; i < size; ++i)
{
ret += fixedPrefix;
ret += strings[i];
ret += '\n';
}
ret += fixedPrefix;
ret += zfText("======================== stack end =======================");
zffree(strings);
zffree(array);
}
示例2: zfText
ZF_NAMESPACE_GLOBAL_BEGIN
void ZFRegExpResult::objectInfoT(ZF_IN_OUT zfstring &ret) const
{
ret += ZFTOKEN_ZFObjectInfoLeft;
if(this->matched)
{
ret += zfText("matched");
if(this->matchedRange != zfindexRangeZero)
{
ret += zfText(" in ");
zfindexRangeToString(ret, this->matchedRange);
}
if(!this->namedGroups.isEmpty())
{
ret += zfText(", named groups: ");
for(zfindex i = 0; i < this->namedGroups.count(); ++i)
{
if(i != 0)
{
ret += zfText(", ");
}
zfindexRangeToString(ret, this->namedGroups[i]);
}
}
}
else
{
ret += zfText("no match");
}
ret += ZFTOKEN_ZFObjectInfoRight;
}
示例3: zfstringAppend
ZF_NAMESPACE_GLOBAL_BEGIN
// ============================================================
// ZFListenerData
void ZFListenerData::objectInfoT(ZF_IN_OUT zfstring &ret) const
{
ret += ZFTOKEN_ZFObjectInfoLeft;
zfstringAppend(ret, zfText("ZFListenerData(%p)"), this);
const zfchar *eventName = ZFObserverEventGetName(this->eventId);
if(eventName != zfnull)
{
ret += zfText(", event: ");
ret += eventName;
}
if(this->sender != zfnull)
{
ret += zfText(", sender: ");
ZFobjectInfoT(ret, this->sender);
}
if(this->param0 != zfnull)
{
ret += zfText(", param0: ");
ZFobjectInfoT(ret, this->param0);
}
if(this->param1 != zfnull)
{
ret += zfText(", param1: ");
ZFobjectInfoT(ret, this->param1);
}
ret += ZFTOKEN_ZFObjectInfoRight;
}
示例4: prepareChildren
void prepareChildren(ZF_IN ZFUILinearLayout *layout)
{
for(zfindex i = 0; i < 3; ++i)
{
zfblockedAlloc(ZFUITextView, child);
layout->childAdd(child);
child->textContentStringSet(zfstringWithFormat(zfText("text %zi"), i));
child->textAlignSet(ZFUIAlign::e_Center);
child->viewBackgroundColorSet(ZFUIColorRandom(255));
}
layout->childAtIndex(1)->layoutParam<ZFUILinearLayoutParam *>()->layoutWeightSet(1);
layout->childAtIndex(2)->layoutParam<ZFUILinearLayoutParam *>()->layoutWeightSet(2);
zfblockedAlloc(ZFUILinearLayout, l);
layout->childAdd(l);
l->layoutOrientationSet(ZFUIOrientation::e_Bottom);
for(zfindex i = 0; i < 3; ++i)
{
zfblockedAlloc(ZFUITextView, child);
l->childAdd(child);
child->textContentStringSet(zfstringWithFormat(zfText("text %zi"), 3 + i));
child->textAlignSet(ZFUIAlign::e_Center);
child->viewBackgroundColorSet(ZFUIColorRandom(255));
}
}
示例5: test
void test(void)
{
this->testCaseOutput(zfLang(zfText("hello")));
this->testCaseOutput(zfLang(zfText("hello with no localized string")));
this->testCaseOutput(zfLang(zfText("hello in default only")));
this->testCaseOutput(zfLang(zfText("hello in custom only")));
this->testCaseOutput(zfstringWithFormat(zfLang(zfText("hello with format: %s")).cString(), zfText("i'm passed string")));
}
示例6: zfLangDebug
void zfLangDebug(ZF_IN_OPT const ZFOutputCallback &output /* = ZFOutputCallbackDefault */)
{
_ZFP_ZFLangMapType &m = _ZFP_ZFLangMapGlobal();
for(_ZFP_ZFLangMapType::iterator it = m.begin(); it != m.end(); ++it)
{
output << it->first << zfText(" = \"") << it->second << zfText("\"\n");
}
}
示例7: ZF_GLOBAL_INITIALIZER_INIT_WITH_LEVEL
ZF_GLOBAL_INITIALIZER_INIT_WITH_LEVEL(_ZFP_ZFJsonOutputFlagsInit, ZFLevelZFFrameworkNormal)
{
_ZFP_ZFJsonOutputFlagsTrimInstance.jsonToken.jsonNewLineToken.removeAll();
_ZFP_ZFJsonOutputFlagsTrimInstance.jsonToken.jsonIndentToken.removeAll();
_ZFP_ZFJsonOutputFlagsTrimInstance.jsonToken.jsonValueSeparatorToken = zfText(":");
_ZFP_ZFJsonOutputFlagsTrimInstance.jsonToken.jsonSeparatorInSameLineToken = zfText(",");
_ZFP_ZFJsonOutputFlagsTrimInstance.jsonObjectAddNewLineForContent = zffalse;
_ZFP_ZFJsonOutputFlagsTrimInstance.jsonArrayAddNewLineForContent = zffalse;
}
示例8: ZFPROPERTY_TYPE_DECLARE_SERIALIZE_TO_DEFINE
ZFPROPERTY_TYPE_DECLARE_SERIALIZE_TO_DEFINE(ZFCallback, ZFCallback)
{
if(v.callbackSerializeCustomType() != zfnull)
{
if(v.callbackSerializeCustomData() == zfnull)
{
ZFSerializableUtil::errorOccurred(outErrorHintToAppend, zfText("missing callback serialize custom data"));
return zffalse;
}
serializableData.itemClassSet(ZFPropertyTypeId_ZFCallback);
serializableData.attributeSet(ZFSerializableKeyword_ZFCallback_callbackType, v.callbackSerializeCustomType());
ZFSerializableData customData = v.callbackSerializeCustomData()->copy();
customData.categorySet(ZFSerializableKeyword_ZFCallback_callbackData);
serializableData.elementAdd(customData);
return zftrue;
}
switch(v.callbackType())
{
case ZFCallbackTypeDummy:
serializableData.itemClassSet(ZFSerializableKeyword_null);
break;
case ZFCallbackTypeMethod:
{
serializableData.itemClassSet(ZFPropertyTypeId_ZFCallback);
ZFSerializableData methodData;
if(!ZFMethodToSerializableData(methodData, v.callbackMethod(), outErrorHintToAppend))
{
return zffalse;
}
methodData.categorySet(ZFSerializableKeyword_ZFCallback_method);
serializableData.elementAdd(methodData);
}
break;
case ZFCallbackTypeMemberMethod:
{
ZFSerializableUtil::errorOccurred(outErrorHintToAppend,
zfText("member method callback is not supported"));
return zffalse;
}
break;
case ZFCallbackTypeRawFunction:
serializableData.itemClassSet(ZFPropertyTypeId_ZFCallback);
ZFSerializableUtil::errorOccurred(outErrorHintToAppend,
zfText("raw function is not supported"));
return zffalse;
default:
zfCoreCriticalShouldNotGoHere();
return zffalse;
}
return zftrue;
}
示例9: zfHint
void ZFClassFilter::objectInfoVerboseT(ZF_IN_OUT zfstring &ret) const
{
this->_ZFP_ZFClassFilter_filters.objectInfoOfContentT(ret,
zfHint("max count")zfindexMax,
zfText("["),
zfText("]"),
zfText(", "),
zfText("..."),
_ZFP_ZFClassFilter_contentInfoGetter);
}
示例10: zfsFromIntStr
void ZFUIKeyEvent::objectInfoVerboseT(ZF_IN_OUT zfstring &ret)
{
ret += ZFTOKEN_ZFObjectInfoLeft;
ret += zfsFromIntStr(this->keyId);
ret += zfText(" ");
ret += ZFUIKeyAction::EnumNameForValue(this->keyAction);
ret += zfText(" ");
ret += ZFUIKeyCode::EnumNameForValue(this->keyCode);
ret += ZFTOKEN_ZFObjectInfoRight;
}
示例11: ZF_GLOBAL_INITIALIZER_INIT_WITH_LEVEL
ZF_GLOBAL_INITIALIZER_INIT_WITH_LEVEL(ZFTextTemplateRunParamDefaultSetting, ZFLevelZFFrameworkNormal)
{
#if 0
_ZFP_ZFTextTemplateRunParamDefault_folderNameFilterRule = zfAlloc(ZFRegExp);
ZFTextTemplateRunParamDefault.folderNameFilter.customFilterCallbackAdd(_ZFP_ZFTextTemplateRunParamDefault_folderNameFilter);
_ZFP_ZFTextTemplateRunParamDefault_folderNameFilterRule->regExpCompile(zfText(
""
));
#endif
_ZFP_ZFTextTemplateRunParamDefault_folderContentFilterRule = zfAlloc(ZFRegExp);
ZFTextTemplateRunParamDefault.folderContentFilter.customFilterCallbackAdd(_ZFP_ZFTextTemplateRunParamDefault_folderContentFilter);
_ZFP_ZFTextTemplateRunParamDefault_folderContentFilterRule->regExpCompile(zfText(
"(^\\.git$)"
"|(^\\.svn$)"
"|(^\\.hg$)"
));
#if 0
_ZFP_ZFTextTemplateRunParamDefault_fileNameFilterRule = zfAlloc(ZFRegExp);
ZFTextTemplateRunParamDefault.fileNameFilter.customFilterCallbackAdd(_ZFP_ZFTextTemplateRunParamDefault_fileNameFilter);
_ZFP_ZFTextTemplateRunParamDefault_fileNameFilterRule->regExpCompile(zfText(
""
));
#endif
_ZFP_ZFTextTemplateRunParamDefault_fileContentFilterRule = zfAlloc(ZFRegExp);
ZFTextTemplateRunParamDefault.fileContentFilter.customFilterCallbackAdd(_ZFP_ZFTextTemplateRunParamDefault_fileContentFilter);
_ZFP_ZFTextTemplateRunParamDefault_fileContentFilterRule->regExpCompile(zfText(
"(\\.ico$)"
"|(\\.icns$)"
"|(\\.png$)"
"|(\\.jpg$)"
"|(\\.jpeg$)"
"|(\\.gif$)"
"|(\\.mp2$)"
"|(\\.mp3$)"
"|(\\.mp4$)"
"|(\\.wav$)"
"|(\\.ogg$)"
"|(\\.db$)"
"|(\\.rar$)"
"|(\\.zip$)"
"|(\\.7z$)"
"|(\\.a(\\..*)*$)"
"|(\\.o(\\..*)*$)"
"|(\\.so(\\..*)*$)"
"|(\\.dll(\\..*)*$)"
"|(\\.dylib(\\..*)*$)"
));
}
示例12: zfsFromPointerT
void ZFUIOnScreenKeyboardState::objectInfoOnAppend(ZF_IN_OUT zfstring &ret)
{
zfsFromPointerT(ret, this->ownerSysWindow());
if(this->keyboardShowing())
{
ret += zfText(" keyboardFrame: ");
ZFUIRectToString(ret, this->keyboardFrame());
}
else
{
ret += zfText(" keyboardNotShow");
}
}
示例13: switch
const zfchar *ZFMethod::methodPrivilegeTypeString(void) const
{
switch(this->_ZFP_ZFMethod_privilegeType)
{
case ZFMethodPrivilegeTypePublic:
return zfText("public");
case ZFMethodPrivilegeTypeProtected:
return zfText("protected");
case ZFMethodPrivilegeTypePrivate:
return zfText("private");
}
return zfText("<UnknownPrivilegeType>");
}
示例14: protocolOnInit
zfoverride
virtual void protocolOnInit(void)
{
zfsuper::protocolOnInit();
this->_resRootPath = ZFFile::modulePath();
this->_resRootPath += ZFFile::fileSeparator;
#if ZF_ENV_sys_MacOS
this->_resRootPath += zfText("..");
this->_resRootPath += ZFFile::fileSeparator;
this->_resRootPath += zfText("Resources");
this->_resRootPath += ZFFile::fileSeparator;
#endif
this->_resRootPath += zfText("res");
this->_resRootPath += ZFFile::fileSeparator;
}
示例15: zfText
void ZFMethod::objectInfoT(ZF_IN_OUT zfstring &ret) const
{
if(this->methodType() == ZFMethodTypeRawFunction)
{
ret += this->methodNamespace();
ret += zfText("::");
ret += this->methodName();
}
else
{
ret += this->ownerClass()->className();
ret += zfText("::");
ret += this->methodName();
}
}