klee
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PrintContext Class Reference

#include <PrintContext.h>

Public Member Functions

 PrintContext (llvm::raw_ostream &_os)
 
void setNewline (const std::string &_newline)
 
void breakLine (unsigned indent=0)
 
PrintContextbreakLineI ()
 
PrintContextpushIndent ()
 
PrintContextpopIndent ()
 
void write (const std::string &s)
 
template<typename T >
PrintContextoperator<< (T elt)
 

Public Attributes

unsigned pos
 Number of characters on the current line. More...
 

Private Attributes

llvm::raw_ostream & os
 
std::string newline
 
std::stack< unsigned int > indentStack
 

Detailed Description

PrintContext - Helper class for pretty printing. It provides a basic wrapper around llvm::raw_ostream that keeps track of how many characters have been used on the current line.

It also provides an optional way keeping track of the various levels of indentation by using a stack.

See also
breakLineI() ,
pushIndent(),
popIndent()

Definition at line 17 of file PrintContext.h.

Constructor & Destructor Documentation

PrintContext::PrintContext ( llvm::raw_ostream &  _os)
inline

Definition at line 32 of file PrintContext.h.

References indentStack, and pos.

Member Function Documentation

void PrintContext::breakLine ( unsigned  indent = 0)
inline
PrintContext& PrintContext::breakLineI ( )
inline

Break line using the indent on the top of the indent stack

Returns
The PrintContext object so the method is chainable

Definition at line 50 of file PrintContext.h.

References breakLine(), and indentStack.

Referenced by klee::ExprSMTLIBPrinter::printArrayDeclarations(), klee::ExprSMTLIBPrinter::printCastToSort(), klee::ExprSMTLIBPrinter::printConstraints(), klee::ExprSMTLIBLetPrinter::printLetExpression(), klee::ExprSMTLIBPrinter::printQuery(), and klee::ExprSMTLIBPrinter::printSeperator().

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
PrintContext& PrintContext::operator<< ( elt)
inline

Definition at line 80 of file PrintContext.h.

References write().

Here is the call graph for this function:

void PrintContext::setNewline ( const std::string &  _newline)
inline

Definition at line 37 of file PrintContext.h.

References newline.

void PrintContext::write ( const std::string &  s)
inline

write - Output a string to the stream and update the position. The stream should not have any newlines.

Definition at line 74 of file PrintContext.h.

References os, and pos.

Referenced by operator<<(), and klee::ExprSMTLIBPrinter::printSeperator().

Here is the caller graph for this function:

Member Data Documentation

std::stack<unsigned int> PrintContext::indentStack
private

This is used to keep track of the stack of indentations used by

See also
breakLineI()
pushIndent()
popIndent()

Definition at line 26 of file PrintContext.h.

Referenced by breakLineI(), popIndent(), PrintContext(), and pushIndent().

std::string PrintContext::newline
private

Definition at line 20 of file PrintContext.h.

Referenced by breakLine(), and setNewline().

llvm::raw_ostream& PrintContext::os
private

Definition at line 19 of file PrintContext.h.

Referenced by breakLine(), and write().

unsigned PrintContext::pos

Number of characters on the current line.

Definition at line 30 of file PrintContext.h.

Referenced by breakLine(), PPrinter::print(), PrintContext(), klee::ExprPPrinter::printQuery(), PPrinter::printUpdateList(), pushIndent(), and write().


The documentation for this class was generated from the following file: