当前位置: 首页>>代码示例>>C++>>正文


C++ IObject::ToString方法代码示例

本文整理汇总了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;
}
开发者ID:canercandan,项目名称:abstractvm,代码行数:34,代码来源:VM.cpp

示例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;
}
开发者ID:XilongPei,项目名称:Elastos5,代码行数:15,代码来源:WindowElastos.cpp

示例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;
}
开发者ID:canercandan,项目名称:abstractvm,代码行数:21,代码来源:VM.cpp

示例4: Equals

bool avm_elem::Equals(const IObject &value) const
{
  return(this->ToString() == value.ToString());
}
开发者ID:Surogate,项目名称:avmfrandflo,代码行数:4,代码来源:avm_elem.cpp


注:本文中的IObject::ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。