From: divverent Date: Wed, 4 Mar 2009 14:59:20 +0000 (+0000) Subject: remove now unused LeftJustified classs (it is perfectly correctly coded, but crashes... X-Git-Tag: svn-r421~211 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=bc8893fcd762eb76602acab4bcff3a330f024180;p=xonotic%2Fnetradiant.git remove now unused LeftJustified classs (it is perfectly correctly coded, but crashes on intel macs on leopard, so forget it) git-svn-id: svn://svn.icculus.org/netradiant/trunk@209 61c419a2-8eb2-4b30-bcec-8cead039b335 --- diff --git a/libs/stream/textstream.h b/libs/stream/textstream.h index fff8a457..60a7821e 100644 --- a/libs/stream/textstream.h +++ b/libs/stream/textstream.h @@ -252,59 +252,6 @@ inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const return ostream; } -template -class LeftJustified -{ -public: - const T& m_t; - std::size_t m_size; - LeftJustified(const T& t, std::size_t size) : m_t(t), m_size(size) - { - } -}; - -template -LeftJustified makeLeftJustified(const T& t, std::size_t size) -{ - return LeftJustified(t, size); -} - -template -class CountingOutputStream -{ - TextOutputStreamType& m_ostream; -public: - std::size_t m_count; - CountingOutputStream(TextOutputStreamType& ostream) : m_ostream(ostream) - { - } - std::size_t write(const char* buffer, std::size_t length) - { - m_count += length; - return m_ostream.write(buffer, length); - } -}; - -template -inline CountingOutputStream& operator<<(CountingOutputStream& ostream, const T& t) -{ - return ostream_write(ostream, t); -} - - -/// \brief Writes any type to \p ostream padded with spaces afterwards. -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const LeftJustified& justified) -{ - CountingOutputStream count(ostream); - count << justified.m_t; - while(justified.m_size > count.m_count) - { - count << ' '; - } - return ostream; -} - class FloatFormat { public: