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


C++ zstring::str方法代码示例

本文整理汇总了C++中zstring::str方法的典型用法代码示例。如果您正苦于以下问题:C++ zstring::str方法的具体用法?C++ zstring::str怎么用?C++ zstring::str使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在zstring的用法示例。


在下文中一共展示了zstring::str方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ref_s

void PrinterVisitor::
beginVisitFlworForVariable( zstring const &varName,
                            vector<PlanIter_t> const &varRefs,
                            vector<PlanIter_t> const &posRefs ) {
  thePrinter.startBeginVisit( "ForVariable", ++theId );
  thePrinter.addAttribute( "name", varName.str() );

  ostringstream ref_oss;
  vector<PlanIter_t>::size_type const numRefs = varRefs.size();
  for ( vector<PlanIter_t>::size_type i = 0; i < numRefs; ++i ) {
#ifndef NDEBUG
    ref_oss << varRefs[i]->getId();
#else
    ref_oss << varRefs[i].getp();
#endif
    if ( i < numRefs - 1 )
      ref_oss << ' ';
  }

  if ( !Properties::instance().getNoTreeIDs() )
    thePrinter.addAttribute( "referenced-by", ref_oss.str() );

  if ( !posRefs.empty() ) {
    string const ref_s( var_refs( posRefs ) );
    if ( !Properties::instance().getNoTreeIDs() )
      thePrinter.addAttribute( "pos-referenced-by", ref_s );
  }

  thePrinter.endBeginVisit( theId );
}
开发者ID:cezarfx,项目名称:zorba,代码行数:30,代码来源:printer_visitor_impl.cpp

示例2:

void PrinterVisitor::
beginVisitFlworLetVariable( bool materialize, zstring const &varName,
                            vector<PlanIter_t> const &varRefs ) {
  thePrinter.startBeginVisit( "LetVariable", ++theId );

  thePrinter.addAttribute( "name", varName.str() );
  thePrinter.addAttribute( "materialize", materialize ? "true" : "false");

  ostringstream str;
  vector<PlanIter_t>::size_type const numRefs = varRefs.size();
  for ( vector<PlanIter_t>::size_type i = 0; i < numRefs; ++i ) {
#ifndef NDEBUG
    str << varRefs[i]->getId();
#else
    str << varRefs[i].getp();
#endif
    if ( i < numRefs - 1 )
      str << ' ';
  }

  if ( !Properties::instance().getNoTreeIDs() )
    thePrinter.addAttribute( "referenced-by", str.str() );

  thePrinter.endBeginVisit( theId );
}
开发者ID:cezarfx,项目名称:zorba,代码行数:25,代码来源:printer_visitor_impl.cpp

示例3: printVarRefs

void PrinterVisitor::
beginVisitWinCondVariable( zstring const &varName,
                           vector<PlanIter_t> const &varRefs ) {
  thePrinter.startBeginVisit( "WinCondVariable", theId );
  thePrinter.addAttribute( "name", varName.str() );

  if ( !Properties::instance().getNoTreeIDs() )
    printVarRefs( "referenced-by", varRefs );

  thePrinter.endBeginVisit( theId );
}
开发者ID:buchenberg,项目名称:zorba,代码行数:11,代码来源:printer_visitor_impl.cpp


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