indent classes, align by spaces
This commit is contained in:
@@ -27,47 +27,47 @@
|
||||
class SimpleTokenWriter final : public TokenWriter
|
||||
{
|
||||
public:
|
||||
SimpleTokenWriter( TextOutputStream& ostream )
|
||||
: m_ostream( ostream ), m_separator( '\n' ){
|
||||
}
|
||||
~SimpleTokenWriter(){
|
||||
writeSeparator();
|
||||
}
|
||||
void release(){
|
||||
delete this;
|
||||
}
|
||||
void nextLine(){
|
||||
m_separator = '\n';
|
||||
}
|
||||
void writeToken( const char* token ){
|
||||
ASSERT_MESSAGE( strchr( token, ' ' ) == 0, "token contains whitespace: " );
|
||||
writeSeparator();
|
||||
m_ostream << token;
|
||||
}
|
||||
void writeString( const char* string ){
|
||||
writeSeparator();
|
||||
m_ostream << '"' << string << '"';
|
||||
}
|
||||
void writeInteger( int i ){
|
||||
writeSeparator();
|
||||
m_ostream << i;
|
||||
}
|
||||
void writeUnsigned( std::size_t i ){
|
||||
writeSeparator();
|
||||
m_ostream << Unsigned( i );
|
||||
}
|
||||
void writeFloat( double f ){
|
||||
writeSeparator();
|
||||
m_ostream << Decimal( f );
|
||||
}
|
||||
SimpleTokenWriter( TextOutputStream& ostream )
|
||||
: m_ostream( ostream ), m_separator( '\n' ){
|
||||
}
|
||||
~SimpleTokenWriter(){
|
||||
writeSeparator();
|
||||
}
|
||||
void release(){
|
||||
delete this;
|
||||
}
|
||||
void nextLine(){
|
||||
m_separator = '\n';
|
||||
}
|
||||
void writeToken( const char* token ){
|
||||
ASSERT_MESSAGE( strchr( token, ' ' ) == 0, "token contains whitespace: " );
|
||||
writeSeparator();
|
||||
m_ostream << token;
|
||||
}
|
||||
void writeString( const char* string ){
|
||||
writeSeparator();
|
||||
m_ostream << '"' << string << '"';
|
||||
}
|
||||
void writeInteger( int i ){
|
||||
writeSeparator();
|
||||
m_ostream << i;
|
||||
}
|
||||
void writeUnsigned( std::size_t i ){
|
||||
writeSeparator();
|
||||
m_ostream << Unsigned( i );
|
||||
}
|
||||
void writeFloat( double f ){
|
||||
writeSeparator();
|
||||
m_ostream << Decimal( f );
|
||||
}
|
||||
|
||||
private:
|
||||
void writeSeparator(){
|
||||
m_ostream << m_separator;
|
||||
m_separator = ' ';
|
||||
}
|
||||
TextOutputStream& m_ostream;
|
||||
char m_separator;
|
||||
void writeSeparator(){
|
||||
m_ostream << m_separator;
|
||||
m_separator = ' ';
|
||||
}
|
||||
TextOutputStream& m_ostream;
|
||||
char m_separator;
|
||||
};
|
||||
|
||||
inline TokenWriter& NewSimpleTokenWriter( TextOutputStream& ostream ){
|
||||
|
||||
Reference in New Issue
Block a user