本文整理汇总了C++中IObject::ToString方法的典型用法代码示例。如果您正苦于以下问题:C++ IObject::ToString方法的具体用法?C++ IObject::ToString怎么用?C++ IObject::ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IObject
的用法示例。
在下文中一共展示了IObject::ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void VM::actAssert(myListStack::const_iterator& it,
myListStack::const_iterator& end,
VMStack& stack)
{
IObject *op;
if (stack.size() < 1)
return;
std::cout << "[assert] ";
while (++it != end)
{
op = Factory::makeNumber(*it);
try
{
if (op->ToString() != stack.back()->ToString())
throw 1;
if (op->GetType() != stack.back()->GetType())
throw 2;
}
catch (int e)
{
std::cout << "The value on top of the stack does "
<< "not equal the operand." << std::endl;
if (e == 1)
std::cout << " -> " << op->ToString() << " <> "
<< stack.back()->ToString() << std::endl;
else if (e == 2)
std::cout << " -> " << op->GetType() << " <> "
<< stack.back()->GetType() << std::endl;
exit(-1);
}
}
std::cout << "Good test" << std::endl;
}
示例2: ShowCancelableIntent
Int32 WindowElastos::ShowCancelableIntent(
/* [in] */ IIntent* intent,
/* [in] */ IntentCallback* callback,
/* [in] */ Int32 errorId)
{
// ==================before translated======================
// Log.d(TAG, "Can't show intent as context is not an Activity: " + intent);
// return START_INTENT_FAILURE;
String intentStr;
IObject* objTmp = IObject::Probe(intent);
objTmp->ToString(&intentStr);
Logger::D(TAG, String("Can't show intent as context is not an Activity: ") + intentStr);
return START_INTENT_FAILURE;
}
示例3:
void VM::actDiv(myListStack::const_iterator&,
myListStack::const_iterator&,
VMStack& stack)
{
IOperand *op1;
IOperand *op2;
IObject *res;
if (stack.size() < 2)
return;
op2 = static_cast<IOperand*>(stack.back());
stack.pop_back();
op1 = static_cast<IOperand*>(stack.back());
stack.pop_back();
res = op1->Divide(*op2);
stack.push_back(res);
std::cout << "[div] "
<< op1->ToString() << " / "
<< op2->ToString() << " = "
<< res->ToString() << std::endl;
}
示例4: Equals
bool avm_elem::Equals(const IObject &value) const
{
return(this->ToString() == value.ToString());
}