Changeset 3f7e12cb for src/Common/Indenter.h
- Timestamp:
- Nov 8, 2017, 5:43:33 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 954908d
- Parents:
- 78315272 (diff), e35f30a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/Indenter.h
r78315272 r3f7e12cb 18 18 19 19 struct Indenter { 20 Indenter( unsigned int amt = 2 ) : amt( amt ) {} 21 unsigned int amt = 2; // amount 1 level increases indent by (i.e. how much to increase by in operator++) 22 unsigned int indent = 0; 20 static unsigned tabsize; 21 22 Indenter( unsigned int amt = tabsize, unsigned int indent = 0 ) : amt( amt ), indent( indent ) {} 23 unsigned int amt; // amount 1 level increases indent by (i.e. how much to increase by in operator++) 24 unsigned int indent; 23 25 24 26 Indenter & operator+=(int nlevels) { indent += amt*nlevels; return *this; } … … 30 32 }; 31 33 32 inline std::ostream & operator<<( std::ostream & out, Indenter & indent ) {34 inline std::ostream & operator<<( std::ostream & out, const Indenter & indent ) { 33 35 return out << std::string(indent.indent, ' '); 34 36 }
Note:
See TracChangeset
for help on using the changeset viewer.