00001 // 00002 // aegis - project change supervisor 00003 // Copyright (C) 1999, 2002, 2005, 2006, 2008 Peter Miller 00004 // 00005 // This program is free software; you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation; either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // This program is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with this program. If not, see 00017 // <http://www.gnu.org/licenses/>. 00018 // 00019 00020 #ifndef LIBAEGIS_WIDE_OUTPUT_WRAP_H 00021 #define LIBAEGIS_WIDE_OUTPUT_WRAP_H 00022 00023 #include <common/wstring/accumulator.h> 00024 #include <libaegis/wide_output.h> 00025 00032 class wide_output_wrap: 00033 public wide_output 00034 { 00035 public: 00039 virtual ~wide_output_wrap(); 00040 00041 private: 00051 wide_output_wrap(const wide_output::pointer &deeper, int width); 00052 00053 public: 00063 static pointer open(const wide_output::pointer &deeper, int width = -1); 00064 00065 protected: 00066 // See base class for documentation. 00067 nstring filename(); 00068 00069 // See base class for documentation. 00070 int page_width(); 00071 00072 // See base class for documentation. 00073 int page_length(); 00074 00075 // See base class for documentation. 00076 const char *type_name() const; 00077 00078 // See base class for documentation. 00079 void write_inner(const wchar_t *data, size_t len); 00080 00081 // See base class for documentation. 00082 void flush_inner(); 00083 00084 // See base class for documentation. 00085 void end_of_line_inner(); 00086 00087 private: 00088 wide_output::pointer deeper; 00089 int width; 00090 wstring_accumulator buf; 00091 00092 void wrap(); 00093 00097 wide_output_wrap(); 00098 00102 wide_output_wrap(const wide_output_wrap &); 00103 00107 wide_output_wrap &operator=(const wide_output_wrap &); 00108 }; 00109 00110 #endif // LIBAEGIS_WIDE_OUTPUT_WRAP_H