From: helly Date: Thu, 29 Dec 2005 22:40:21 +0000 (+0000) Subject: - Move null_stream into haeder X-Git-Tag: 0.13.6~546 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8db621509355c1863ae4cb42936678b1151562a5;p=re2c - Move null_stream into haeder --- diff --git a/code.cc b/code.cc index 0c41c55c..32e0fab5 100644 --- a/code.cc +++ b/code.cc @@ -1009,38 +1009,6 @@ void DFA::split(State *s) s->go.span[0].to = move; } -class null_stream: public std::ostream -{ -public: - null_stream() - : std::ostream(&ns) - { - } - - null_stream& put(char_type) - { - // nothing to do - return *this; - } - - null_stream& write(const char_type *, std::streamsize) - { - // nothing to do - return *this; - } - -protected: - class null_streambuf: public std::streambuf - { - public: - null_streambuf() - : std::streambuf() - { - } - }; - null_streambuf ns; -}; - void DFA::emit(std::ostream &o) { static uint label = 0; diff --git a/code.h b/code.h index e44488d3..2259fda9 100755 --- a/code.h +++ b/code.h @@ -28,6 +28,38 @@ public: ~BitMap(); }; +class null_stream: public std::ostream +{ +public: + null_stream() + : std::ostream(&ns) + { + } + + null_stream& put(char_type) + { + // nothing to do + return *this; + } + + null_stream& write(const char_type *, std::streamsize) + { + // nothing to do + return *this; + } + +protected: + class null_streambuf: public std::streambuf + { + public: + null_streambuf() + : std::streambuf() + { + } + }; + null_streambuf ns; +}; + } // end namespace re2c #endif