Changeset 4e5e6cc for src/Common
- Timestamp:
- Jun 7, 2019, 2:54:34 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- ef75948
- Parents:
- 5684736
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/Indenter.h
r5684736 r4e5e6cc 23 23 unsigned int amt; ///< spaces in one level of indentation 24 24 25 Indenter( unsigned int indent = 0, unsigned int amt = tabsize ) 26 : indent( indent *amt), amt( amt ) {}27 28 Indenter & operator+=(int nlevels) { indent += amt*nlevels; return *this; }29 Indenter & operator-=(int nlevels) { indent -= amt*nlevels; return *this; }25 Indenter( unsigned int indent = 0, unsigned int amt = tabsize ) 26 : indent( indent ), amt( amt ) {} 27 28 Indenter & operator+=(int nlevels) { indent += nlevels; return *this; } 29 Indenter & operator-=(int nlevels) { indent -= nlevels; return *this; } 30 30 Indenter operator+(int nlevels) { Indenter indenter = *this; return indenter += nlevels; } 31 31 Indenter operator-(int nlevels) { Indenter indenter = *this; return indenter -= nlevels; } … … 35 35 36 36 inline std::ostream & operator<<( std::ostream & out, const Indenter & indent ) { 37 return out << std::string(indent.indent , ' ');37 return out << std::string(indent.indent * indent.amt, ' '); 38 38 } 39 39
Note: See TracChangeset
for help on using the changeset viewer.