本文整理汇总了C#中PHP.Core.PhpStack.PeekValueUnchecked方法的典型用法代码示例。如果您正苦于以下问题:C# PhpStack.PeekValueUnchecked方法的具体用法?C# PhpStack.PeekValueUnchecked怎么用?C# PhpStack.PeekValueUnchecked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHP.Core.PhpStack
的用法示例。
在下文中一共展示了PhpStack.PeekValueUnchecked方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Filter
private object Filter(object instance, PhpStack/*!*/ stack)
{
StringBuilder result = new StringBuilder();
Debug.Assert(stack.ArgCount >= 1, "Called by output buffering, so should be ok");
string data = PhpVariable.AsString(stack.PeekValueUnchecked(1));
stack.RemoveFrame();
// parse the text
if (parser == null)
parser = new TagsUrlRewriter(this);
return parser.ParseHtml(parserState, data);
}
示例2: MapIdentity
/// <summary>
/// Default callback for <see cref="Map"/>.
/// </summary>
/// <param name="instance">Unused.</param>
/// <param name="stack">A PHP stack.</param>
/// <returns>A <see cref="PhpArray"/> containing items on the stack (passed as arguments).</returns>
private static object MapIdentity(object instance, PhpStack stack)
{
PhpArray result = new PhpArray(stack.ArgCount, 0);
for (int i = 1; i <= stack.ArgCount; i++)
{
result.Add(PhpVariable.Copy(stack.PeekValueUnchecked(i), CopyReason.PassedByCopy));
}
stack.RemoveFrame();
return result;
}
示例3: InvokeMethodDynamic
public static object InvokeMethodDynamic(string moduleName, string className, string methodName, PhpObject self,
PhpStack stack, int[] refInfo)
{
int arg_count = stack.ArgCount;
object[] args = new object[arg_count];
PhpReference[] references = new PhpReference[arg_count];
// convert arguments on calling stack into the args array
stack.CalleeName = methodName;
int ref_ptr = (refInfo != null && refInfo.Length > 0 ? 0 : -1);
for (int i = 0; i < arg_count; i++)
{
if (ref_ptr >= 0)
{
if (i == refInfo[ref_ptr])
{
args[i] = references[i] = stack.PeekReferenceUnchecked(i + 1);
if (++ref_ptr >= refInfo.Length) ref_ptr = -1;
continue;
}
else if (refInfo[ref_ptr] == -1)
{
args[i] = references[i] = stack.PeekReferenceUnchecked(i + 1);
continue;
}
}
args[i] = stack.PeekValueUnchecked(i + 1);
}
stack.RemoveFrame();
if (refInfo == null || refInfo.Length == 0)
{
return InvokeMethod(moduleName, className, methodName, self, stack.Context, ref args, null);
}
else
{
object ret_val = InvokeMethod(moduleName, className, methodName, self, stack.Context, ref args, refInfo);
// propagate back byref parameters
for (int i = 0; i < arg_count; i++)
{
if (references[i] != null) references[i].Value = args[i];
}
return ret_val;
}
}