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

astyle::ASBeautifier Class Reference

#include <astyle.h>

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

List of all members.

Public Member Functions

 ASBeautifier ()
virtual ~ASBeautifier ()
virtual void init (ASSourceIterator *iter)
virtual void init ()
virtual bool hasMoreLines () const
virtual std::string nextLine ()
virtual std::string beautify (const std::string &line)
void setTabIndentation (int length=4, bool forceTabs=false)
void setSpaceIndentation (int length=4)
void setMaxInStatementIndentLength (int max)
void setMinConditionalIndentLength (int min)
void setClassIndent (bool state)
void setSwitchIndent (bool state)
void setCaseIndent (bool state)
void setBracketIndent (bool state)
void setBlockIndent (bool state)
void setNamespaceIndent (bool state)
void setLabelIndent (bool state)
void setCStyle ()
void setJavaStyle ()
void setEmptyLineFill (bool state)
void setPreprocessorIndent (bool state)

Protected Member Functions

int getNextProgramCharDistance (const std::string &line, int i)
bool isLegalNameChar (char ch) const
bool isWhiteSpace (char ch) const
const std::string * findHeader (const std::string &line, int i, const std::vector< const std::string * > &possibleHeaders, bool checkBoundry=true)
std::string trim (const std::string &str)
int indexOf (std::vector< const std::string * > &container, const std::string *element)

Private Member Functions

 ASBeautifier (const ASBeautifier &copy)
void operator= (ASBeautifier &)
void initStatic ()
void registerInStatementIndent (const std::string &line, int i, int spaceTabCount, int minIndent, bool updateParenStack)
std::string preLineWS (int spaceTabCount, int tabCount)

Private Attributes

ASSourceIteratorsourceIterator
std::vector< ASBeautifier * > * waitingBeautifierStack
std::vector< ASBeautifier * > * activeBeautifierStack
std::vector< int > * waitingBeautifierStackLengthStack
std::vector< int > * activeBeautifierStackLengthStack
std::vector< const std::string * > * headerStack
std::vector< std::vector
< const std::string * > * > * 
tempStacks
std::vector< int > * blockParenDepthStack
std::vector< bool > * blockStatementStack
std::vector< bool > * parenStatementStack
std::vector< int > * inStatementIndentStack
std::vector< int > * inStatementIndentStackSizeStack
std::vector< int > * parenIndentStack
std::vector< bool > * bracketBlockStateStack
std::string indentString
const std::string * currentHeader
const std::string * previousLastLineHeader
const std::string * immediatelyPreviousAssignmentOp
const std::string * probationHeader
bool isInQuote
bool isInComment
bool isInCase
bool isInQuestion
bool isInStatement
bool isInHeader
bool isCStyle
bool isInOperator
bool isInTemplate
bool isInConst
bool isInDefine
bool isInDefineDefinition
bool classIndent
bool isInClassHeader
bool isInClassHeaderTab
bool switchIndent
bool caseIndent
bool namespaceIndent
bool bracketIndent
bool blockIndent
bool labelIndent
bool preprocessorIndent
bool isInConditional
bool isMinimalConditinalIndentSet
bool shouldForceTabIndentation
int minConditionalIndent
int parenDepth
int indentLength
int blockTabCount
int leadingWhiteSpaces
int maxInStatementIndent
int templateDepth
char quoteChar
char prevNonSpaceCh
char currentNonSpaceCh
char currentNonLegalCh
char prevNonLegalCh
int prevFinalLineSpaceTabCount
int prevFinalLineTabCount
bool emptyLineFill
bool backslashEndsPrevLine
int defineTabCount

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 * > 
preBlockStatements
static std::vector< const
std::string * > 
assignmentOperators
static std::vector< const
std::string * > 
nonAssignmentOperators
static bool calledInitStatic

Constructor & Destructor Documentation

astyle::ASBeautifier::ASBeautifier (  ) 
virtual astyle::ASBeautifier::~ASBeautifier (  )  [virtual]
astyle::ASBeautifier::ASBeautifier ( const ASBeautifier copy  )  [private]

Member Function Documentation

virtual std::string astyle::ASBeautifier::beautify ( const std::string &  line  )  [virtual]
const std::string* astyle::ASBeautifier::findHeader ( const std::string &  line,
int  i,
const std::vector< const std::string * > &  possibleHeaders,
bool  checkBoundry = true 
) [protected]
int astyle::ASBeautifier::getNextProgramCharDistance ( const std::string &  line,
int  i 
) [protected]
virtual bool astyle::ASBeautifier::hasMoreLines (  )  const [virtual]

Reimplemented in astyle::ASFormatter.

int astyle::ASBeautifier::indexOf ( std::vector< const std::string * > &  container,
const std::string *  element 
) [protected]
virtual void astyle::ASBeautifier::init (  )  [virtual]
virtual void astyle::ASBeautifier::init ( ASSourceIterator iter  )  [virtual]

Reimplemented in astyle::ASFormatter.

void astyle::ASBeautifier::initStatic (  )  [private]
bool astyle::ASBeautifier::isLegalNameChar ( char  ch  )  const [protected]
bool astyle::ASBeautifier::isWhiteSpace ( char  ch  )  const [protected]
virtual std::string astyle::ASBeautifier::nextLine (  )  [virtual]

Reimplemented in astyle::ASFormatter.

void astyle::ASBeautifier::operator= ( ASBeautifier  )  [private]
std::string astyle::ASBeautifier::preLineWS ( int  spaceTabCount,
int  tabCount 
) [private]
void astyle::ASBeautifier::registerInStatementIndent ( const std::string &  line,
int  i,
int  spaceTabCount,
int  minIndent,
bool  updateParenStack 
) [private]
void astyle::ASBeautifier::setBlockIndent ( bool  state  ) 
void astyle::ASBeautifier::setBracketIndent ( bool  state  ) 
void astyle::ASBeautifier::setCaseIndent ( bool  state  ) 
void astyle::ASBeautifier::setClassIndent ( bool  state  ) 
void astyle::ASBeautifier::setCStyle (  ) 
void astyle::ASBeautifier::setEmptyLineFill ( bool  state  ) 
void astyle::ASBeautifier::setJavaStyle (  ) 
void astyle::ASBeautifier::setLabelIndent ( bool  state  ) 
void astyle::ASBeautifier::setMaxInStatementIndentLength ( int  max  ) 
void astyle::ASBeautifier::setMinConditionalIndentLength ( int  min  ) 
void astyle::ASBeautifier::setNamespaceIndent ( bool  state  ) 
void astyle::ASBeautifier::setPreprocessorIndent ( bool  state  ) 
void astyle::ASBeautifier::setSpaceIndentation ( int  length = 4  ) 
void astyle::ASBeautifier::setSwitchIndent ( bool  state  ) 
void astyle::ASBeautifier::setTabIndentation ( int  length = 4,
bool  forceTabs = false 
)
std::string astyle::ASBeautifier::trim ( const std::string &  str  )  [protected]

Member Data Documentation

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

Reimplemented in astyle::ASFormatter.

std::vector<int>* astyle::ASBeautifier::blockParenDepthStack [private]
std::vector<bool>* astyle::ASBeautifier::blockStatementStack [private]
std::vector<bool>* astyle::ASBeautifier::bracketBlockStateStack [private]

Reimplemented in astyle::ASFormatter.

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

Reimplemented in astyle::ASFormatter.

std::vector<const std::string*> astyle::ASBeautifier::headers [static, private]

Reimplemented in astyle::ASFormatter.

std::vector<const std::string*>* astyle::ASBeautifier::headerStack [private]
std::string astyle::ASBeautifier::indentString [private]
std::vector<int>* astyle::ASBeautifier::inStatementIndentStack [private]

Reimplemented in astyle::ASFormatter.

Reimplemented in astyle::ASFormatter.

Reimplemented in astyle::ASFormatter.

Reimplemented in astyle::ASFormatter.

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

Reimplemented in astyle::ASFormatter.

std::vector<int>* astyle::ASBeautifier::parenIndentStack [private]
std::vector<bool>* astyle::ASBeautifier::parenStatementStack [private]
std::vector<const std::string*> astyle::ASBeautifier::preBlockStatements [static, private]
std::vector<const std::string*> astyle::ASBeautifier::preprocessorHeaders [static, private]

Reimplemented in astyle::ASFormatter.

const std::string* astyle::ASBeautifier::previousLastLineHeader [private]
const std::string* astyle::ASBeautifier::probationHeader [private]

Reimplemented in astyle::ASFormatter.

Reimplemented in astyle::ASFormatter.

std::vector< std::vector<const std::string*>* >* astyle::ASBeautifier::tempStacks [private]

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