本文整理汇总了C++中HphpArray::append方法的典型用法代码示例。如果您正苦于以下问题:C++ HphpArray::append方法的具体用法?C++ HphpArray::append怎么用?C++ HphpArray::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HphpArray
的用法示例。
在下文中一共展示了HphpArray::append方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run_intercept_handler_for_invokefunc
bool run_intercept_handler_for_invokefunc(TypedValue* retval,
const Func* f,
CArrRef params,
ObjectData* this_,
StringData* invName,
Variant* ihandler) {
using namespace HPHP::VM::Transl;
ASSERT(ihandler);
ASSERT(retval);
Variant doneFlag = true;
Array args = params;
if (invName) {
// This is a magic call, so we need to shuffle the args
HphpArray* magicArgs = NEW(HphpArray)(2);
magicArgs->append(invName, false);
magicArgs->append(params, false);
args = magicArgs;
}
Array intArgs =
CREATE_VECTOR5(f->fullNameRef(), (this_ ? Variant(Object(this_)) : null),
args, ihandler->asCArrRef()[1], ref(doneFlag));
call_intercept_handler<false>(retval, intArgs, NULL, ihandler);
// $done is true, meaning don't enter the intercepted function.
return !doneFlag.toBoolean();
}
示例2: pack_args_into_array
// Returned array has refcount one! Caller must not incref.
HphpArray* pack_args_into_array(ActRec* ar, int nargs) {
HphpArray* argArray = HphpArray::MakeReserve(nargs);
for (int i = 0; i < nargs; ++i) {
TypedValue* tv = (TypedValue*)(ar) - (i+1);
argArray->HphpArray::appendWithRef(tvAsCVarRef(tv), false);
}
if (!ar->hasInvName()) {
// If this is not a magic call, we're done
return argArray;
}
// This is a magic call, so we need to shuffle the args
HphpArray* magicArgs = HphpArray::MakeReserve(2);
magicArgs->append(ar->getInvName(), false);
magicArgs->append(argArray, false);
return magicArgs;
}