本文整理汇总了C++中IValue::queryType方法的典型用法代码示例。如果您正苦于以下问题:C++ IValue::queryType方法的具体用法?C++ IValue::queryType怎么用?C++ IValue::queryType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IValue
的用法示例。
在下文中一共展示了IValue::queryType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: transform
void ViewFieldECLTransformer::transform(unsigned & lenTarget, char * & target, unsigned lenSource, const char * source, const HqlExprArray & extraArgs)
{
Owned<ITypeInfo> sourceType = makeUtf8Type(lenSource, 0);
IValue * sourceValue = createUtf8Value(source, LINK(sourceType));
OwnedHqlExpr sourceExpr = createConstant(sourceValue);
HqlExprArray actuals;
actuals.append(*LINK(sourceExpr));
appendArray(actuals, extraArgs);
Owned<IErrorReceiver> errorReporter = createThrowingErrorReceiver();
OwnedHqlExpr call = createBoundFunction(errorReporter, function, actuals, NULL, true);
OwnedHqlExpr castValue = ensureExprType(call, utf8Type);
OwnedHqlExpr folded = quickFoldExpression(castValue, NULL, 0);
IValue * foldedValue = folded->queryValue();
assertex(foldedValue);
unsigned len = foldedValue->queryType()->getStringLen();
const char * data = static_cast<const char *>(foldedValue->queryValue());
unsigned size = rtlUtf8Size(len, data);
lenTarget = len;
target = (char *)rtlMalloc(size);
memcpy(target, data, size);
}