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


C++ raw_ostream::changeColor方法代码示例

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


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

示例1: OS

WithColor::WithColor(llvm::raw_ostream &OS, enum HighlightColor Type) : OS(OS) {
  // Detect color from terminal type unless the user passed the --color option.
  if (UseColor == cl::BOU_UNSET ? OS.has_colors() : UseColor == cl::BOU_TRUE) {
    switch (Type) {
    case Address:    OS.changeColor(llvm::raw_ostream::YELLOW);  break;
    case String:     OS.changeColor(llvm::raw_ostream::GREEN);   break;
    case Tag:        OS.changeColor(llvm::raw_ostream::BLUE);    break;
    case Attribute:  OS.changeColor(llvm::raw_ostream::CYAN);    break;
    case Enumerator: OS.changeColor(llvm::raw_ostream::MAGENTA); break;
    }
  }
}
开发者ID:0x00evil,项目名称:llvm,代码行数:12,代码来源:SyntaxHighlighting.cpp

示例2: assert

 void Transaction::DelayCallInfo::print(llvm::raw_ostream& Out, 
                                        const PrintingPolicy& Policy,
                                        unsigned Indent, 
                                        bool PrintInstantiation, 
                                   llvm::StringRef prependInfo /*=""*/) const {
   static const char* const stateNames[Transaction::kCCINumStates] = {
     "kCCINone",
     "kCCIHandleTopLevelDecl",
     "kCCIHandleInterestingDecl",
     "kCCIHandleTagDeclDefinition",
     "kCCIHandleVTable",
     "kCCIHandleCXXImplicitFunctionInstantiation",
     "kCCIHandleCXXStaticMemberVarInstantiation",
   };
   assert((sizeof(stateNames) /sizeof(void*)) == Transaction::kCCINumStates 
          && "Missing states?");
   if (!prependInfo.empty()) {
     Out.changeColor(llvm::raw_ostream::RED);
     Out << prependInfo;
     Out.resetColor();
     Out << ", ";
   }
   Out.changeColor(llvm::raw_ostream::BLUE);
   Out << stateNames[m_Call]; 
   Out.changeColor(llvm::raw_ostream::GREEN);
   Out << " <- ";
   Out.resetColor();
   for (DeclGroupRef::const_iterator I = m_DGR.begin(), E = m_DGR.end(); 
        I != E; ++I) {
       if (*I)
         (*I)->print(Out, Policy, Indent, PrintInstantiation);
       else
         Out << "<<NULL DECL>>";
       Out << '\n';
   }
 }
开发者ID:Dr15Jones,项目名称:root,代码行数:36,代码来源:Transaction.cpp

示例3: Dump

void Table::Dump(llvm::raw_ostream &OS, llvm::StringRef Prefix) const {
  for(unsigned I = 0, E = RowsCount(); I < E; ++I) {
    if(!Prefix.empty()) {
      OS.changeColor(llvm::raw_ostream::GREEN) << Prefix << ": ";
      OS.resetColor();
    }

    for(unsigned J = 0, K = ColsCount(); J < K; ++J) {
      llvm::StringRef Cell = Columns[J][I];
      OS.indent(Columns[J].GetWidth() - Cell.size()) << Cell;
      if(J != K - 1)
        OS << " ";
    }
    OS << "\n";
  }
}
开发者ID:speziale-ettore,项目名称:OpenCRun,代码行数:16,代码来源:Table.cpp


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