本文整理汇总了C++中Browser::context方法的典型用法代码示例。如果您正苦于以下问题:C++ Browser::context方法的具体用法?C++ Browser::context怎么用?C++ Browser::context使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Browser
的用法示例。
在下文中一共展示了Browser::context方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: do_sysbrowser
SEXP attribute_hidden do_sysbrowser(/*const*/ Expression* call, const BuiltInFunction* op, RObject* n_)
{
int n;
n = asInteger(n_);
if(n < 1 ) error(_("number of contexts must be positive"));
switch (op->variant()) {
case 1: /* text */
case 2: /* condition */
{
if (n > int(Browser::numberActive())) {
if (n == 1)
Rf_error(_("no browser context to query"));
else Rf_error(_("not that many calls to browser are active"));
}
Browser* browser
= Browser::fromOutermost(Browser::numberActive() - n);
return op->variant() == 1 ? browser->text() : browser->condition();
}
break;
case 3: /* turn on debugging n levels up */
{
if (Browser::numberActive() == 0)
Rf_error(_("no browser context to query"));
Browser* browser
= Browser::fromOutermost(Browser::numberActive() - 1);
ClosureContext* cptr = ClosureContext::innermost(browser->context());
while (cptr && n > 1) {
n--;
cptr = ClosureContext::innermost(cptr->nextOut());
}
if (!cptr)
error(_("not that many functions on the call stack"));
else {
SET_RDEBUG(cptr->workingEnvironment(), TRUE);
}
}
break;
}
return nullptr;
}