00001
00002
00003
00004
00005
00006
00008 #ifndef CPPCMS_COPY_FILTER_H
00009 #define CPPCMS_COPY_FILTER_H
00010
00011
00012 #include <booster/streambuf.h>
00013 #include <booster/noncopyable.h>
00014 #include <booster/hold_ptr.h>
00015 #include <cppcms/defs.h>
00016 #include <list>
00017 #include <ostream>
00018
00019 namespace cppcms {
00043 class CPPCMS_API copy_filter : public booster::noncopyable {
00044 public:
00048 copy_filter(std::ostream &output);
00053 ~copy_filter();
00057 std::string detach();
00058
00059 private:
00060 class tee_device;
00061 struct data;
00062 booster::hold_ptr<data> d;
00063 booster::streambuf copy_buffer_;
00064 std::ostream &output_;
00065 std::ostream real_output_stream_;
00066 std::list<std::string> data_;
00067 bool detached_;
00068 };
00069 }
00070
00071
00072 #endif