本文整理汇总了C++中OwnedHqlExpr::hasText方法的典型用法代码示例。如果您正苦于以下问题:C++ OwnedHqlExpr::hasText方法的具体用法?C++ OwnedHqlExpr::hasText怎么用?C++ OwnedHqlExpr::hasText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OwnedHqlExpr
的用法示例。
在下文中一共展示了OwnedHqlExpr::hasText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getAttributeText
void WebServicesExtractor::getAttributeText(StringBuffer & text, const char* attributeName)
{
const char * dot = strrchr(attributeName, '.');
if(!dot || !dot[1])
throw MakeStringException(3, "Please specify both module and attribute");
OwnedHqlExpr symbol = getResolveAttributeFullPath(attributeName, LSFpublic, lookupCtx);
if (!symbol || !hasNamedSymbol(symbol) || !symbol->hasText())
{
StringBuffer txt;
txt.append("Could not read attribute: ").append(attributeName);
DBGLOG("%s", txt.str());
throw MakeStringException(ERR_NO_ATTRIBUTE_TEXT, "%s", txt.str());
}
symbol->getTextBuf(text);
/* MORE: It would be preferable if this was better integrated with hqlgram2.cpp. It's a reasonable stopgap */
if (archive)
{
StringAttr moduleName(attributeName, dot-attributeName);
IPropertyTree * moduleTree = queryEnsureArchiveModule(archive, moduleName, NULL);
IPropertyTree * attrTree = queryArchiveAttribute(moduleTree, dot+1);
if (!attrTree)
{
attrTree = createArchiveAttribute(moduleTree, dot+1);
const char * p = text.str();
if (0 == strncmp(p, UTF8_BOM,3))
p += 3;
attrTree->setProp("", p);
}
}
}