Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

astyle::ASFormatter Class Reference

#include <astyle.h>

Inheritance diagram for astyle::ASFormatter:
Inheritance graph
[legend]
Collaboration diagram for astyle::ASFormatter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ASFormatter ()
virtual ~ASFormatter ()
virtual void init (ASSourceIterator *iter)
virtual bool hasMoreLines () const
virtual std::string nextLine ()
void setBracketFormatMode (BracketMode mode)
void setBreakClosingHeaderBracketsMode (bool state)
void setOperatorPaddingMode (bool mode)
void setParenthesisPaddingMode (bool mode)
void setBreakOneLineBlocksMode (bool state)
void setSingleStatementsMode (bool state)
void setTabSpaceConversionMode (bool state)
void setBreakBlocksMode (bool state)
void setBreakClosingHeaderBlocksMode (bool state)
void setBreakElseIfsMode (bool state)

Private Member Functions

void ASformatter (ASFormatter &copy)
void operator= (ASFormatter &)
void staticInit ()
bool isFormattingEnabled () const
void goForward (int i)
bool getNextChar ()
char peekNextChar () const
bool isBeforeComment () const
void trimNewLine ()
BracketType getBracketType () const
bool isPointerOrReference () const
bool isUrinaryMinus () const
bool isInExponent () const
bool isOneLineBlockReached () const
void appendChar (char ch, bool canBreakLine=true)
void appendCurrentChar (bool canBreakLine=true)
void appendSequence (const std::string &sequence, bool canBreakLine=true)
void appendSpacePad ()
void breakLine ()
bool isSequenceReached (const std::string &sequence) const
const std::string * findHeader (const std::vector< const std::string * > &headers, bool checkBoundry=true)

Private Attributes

ASSourceIteratorsourceIterator
std::vector< const std::string * > * preBracketHeaderStack
std::vector< BracketType > * bracketTypeStack
std::vector< int > * parenStack
std::string readyFormattedLine
std::string currentLine
std::string formattedLine
const std::string * currentHeader
const std::string * previousOperator
char currentChar
char previousChar
char previousNonWSChar
char previousCommandChar
char quoteChar
int charNum
BracketMode bracketFormatMode
bool isVirgin
bool shouldPadOperators
bool shouldPadParenthesies
bool shouldConvertTabs
bool isInLineComment
bool isInComment
bool isInPreprocessor
bool isInTemplate
bool doesLineStartComment
bool isInQuote
bool isSpecialChar
bool isNonParenHeader
bool foundQuestionMark
bool foundPreDefinitionHeader
bool foundPreCommandHeader
bool isInLineBreak
bool isInClosingBracketLineBreak
bool endOfCodeReached
bool isLineReady
bool isPreviousBracketBlockRelated
bool isInPotentialCalculation
bool shouldBreakOneLineBlocks
bool shouldReparseCurrentChar
bool shouldBreakOneLineStatements
bool shouldBreakLineAfterComments
bool shouldBreakClosingHeaderBrackets
bool shouldBreakElseIfs
bool passedSemicolon
bool passedColon
bool isImmediatelyPostComment
bool isImmediatelyPostLineComment
bool isImmediatelyPostEmptyBlock
bool shouldBreakBlocks
bool shouldBreakClosingHeaderBlocks
bool isPrependPostBlockEmptyLineRequested
bool isAppendPostBlockEmptyLineRequested
bool prependEmptyLine
bool foundClosingHeader
int previousReadyFormattedLineLength
bool isInHeader
bool isImmediatelyPostHeader

Static Private Attributes

static std::vector< const
std::string * > 
headers
static std::vector< const
std::string * > 
nonParenHeaders
static std::vector< const
std::string * > 
preprocessorHeaders
static std::vector< const
std::string * > 
preDefinitionHeaders
static std::vector< const
std::string * > 
preCommandHeaders
static std::vector< const
std::string * > 
operators
static std::vector< const
std::string * > 
assignmentOperators
static bool calledInitStatic

Constructor & Destructor Documentation

astyle::ASFormatter::ASFormatter (  ) 
virtual astyle::ASFormatter::~ASFormatter (  )  [virtual]

Member Function Documentation

void astyle::ASFormatter::appendChar ( char  ch,
bool  canBreakLine = true 
) [private]
void astyle::ASFormatter::appendCurrentChar ( bool  canBreakLine = true  )  [private]
void astyle::ASFormatter::appendSequence ( const std::string &  sequence,
bool  canBreakLine = true 
) [private]
void astyle::ASFormatter::appendSpacePad (  )  [private]
void astyle::ASFormatter::ASformatter ( ASFormatter copy  )  [private]
void astyle::ASFormatter::breakLine (  )  [private]
const std::string* astyle::ASFormatter::findHeader ( const std::vector< const std::string * > &  headers,
bool  checkBoundry = true 
) [private]
BracketType astyle::ASFormatter::getBracketType (  )  const [private]
bool astyle::ASFormatter::getNextChar (  )  [private]
void astyle::ASFormatter::goForward ( int  i  )  [private]
virtual bool astyle::ASFormatter::hasMoreLines (  )  const [virtual]

Reimplemented from astyle::ASBeautifier.

virtual void astyle::ASFormatter::init ( ASSourceIterator iter  )  [virtual]

Reimplemented from astyle::ASBeautifier.

bool astyle::ASFormatter::isBeforeComment (  )  const [private]
bool astyle::ASFormatter::isFormattingEnabled (  )  const [private]
bool astyle::ASFormatter::isInExponent (  )  const [private]
bool astyle::ASFormatter::isOneLineBlockReached (  )  const [private]
bool astyle::ASFormatter::isPointerOrReference (  )  const [private]
bool astyle::ASFormatter::isSequenceReached ( const std::string &  sequence  )  const [inline, private]
bool astyle::ASFormatter::isUrinaryMinus (  )  const [private]
virtual std::string astyle::ASFormatter::nextLine (  )  [virtual]

Reimplemented from astyle::ASBeautifier.

void astyle::ASFormatter::operator= ( ASFormatter  )  [private]
char astyle::ASFormatter::peekNextChar (  )  const [private]
void astyle::ASFormatter::setBracketFormatMode ( BracketMode  mode  ) 
void astyle::ASFormatter::setBreakBlocksMode ( bool  state  ) 
void astyle::ASFormatter::setBreakClosingHeaderBlocksMode ( bool  state  ) 
void astyle::ASFormatter::setBreakClosingHeaderBracketsMode ( bool  state  ) 
void astyle::ASFormatter::setBreakElseIfsMode ( bool  state  ) 
void astyle::ASFormatter::setBreakOneLineBlocksMode ( bool  state  ) 
void astyle::ASFormatter::setOperatorPaddingMode ( bool  mode  ) 
void astyle::ASFormatter::setParenthesisPaddingMode ( bool  mode  ) 
void astyle::ASFormatter::setSingleStatementsMode ( bool  state  ) 
void astyle::ASFormatter::setTabSpaceConversionMode ( bool  state  ) 
void astyle::ASFormatter::staticInit (  )  [private]
void astyle::ASFormatter::trimNewLine (  )  [private]

Member Data Documentation

std::vector<const std::string*> astyle::ASFormatter::assignmentOperators [static, private]

Reimplemented from astyle::ASBeautifier.

bool astyle::ASFormatter::calledInitStatic [static, private]

Reimplemented from astyle::ASBeautifier.

const std::string* astyle::ASFormatter::currentHeader [private]

Reimplemented from astyle::ASBeautifier.

std::string astyle::ASFormatter::currentLine [private]
std::string astyle::ASFormatter::formattedLine [private]
std::vector<const std::string*> astyle::ASFormatter::headers [static, private]

Reimplemented from astyle::ASBeautifier.

Reimplemented from astyle::ASBeautifier.

Reimplemented from astyle::ASBeautifier.

Reimplemented from astyle::ASBeautifier.

Reimplemented from astyle::ASBeautifier.

std::vector<const std::string*> astyle::ASFormatter::nonParenHeaders [static, private]

Reimplemented from astyle::ASBeautifier.

std::vector<const std::string*> astyle::ASFormatter::operators [static, private]
std::vector<int>* astyle::ASFormatter::parenStack [private]
std::vector<const std::string*>* astyle::ASFormatter::preBracketHeaderStack [private]
std::vector<const std::string*> astyle::ASFormatter::preCommandHeaders [static, private]
std::vector<const std::string*> astyle::ASFormatter::preDefinitionHeaders [static, private]
std::vector<const std::string*> astyle::ASFormatter::preprocessorHeaders [static, private]

Reimplemented from astyle::ASBeautifier.

const std::string* astyle::ASFormatter::previousOperator [private]

Reimplemented from astyle::ASBeautifier.

Reimplemented from astyle::ASBeautifier.


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