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_TRUNCATE_H 00021 #define LIBAEGIS_WIDE_OUTPUT_TRUNCATE_H 00022 00023 #include <common/wstring/accumulator.h> 00024 #include <libaegis/wide_output.h> 00025 00031 class wide_output_truncate: 00032 public wide_output 00033 { 00034 public: 00038 virtual ~wide_output_truncate(); 00039 00040 private: 00050 wide_output_truncate(const wide_output::pointer &deeper, int width); 00051 00052 public: 00062 static pointer open(const wide_output::pointer &deeper, int width); 00063 00064 protected: 00065 // See base class for documentation. 00066 nstring filename(); 00067 00068 // See base class for documentation. 00069 int page_width(); 00070 00071 // See base class for documentation. 00072 int page_length(); 00073 00074 // See base class for documentation. 00075 const char *type_name() const; 00076 00077 // See base class for documentation. 00078 void write_inner(const wchar_t *data, size_t len); 00079 00080 // See base class for documentation. 00081 void flush_inner(); 00082 00083 // See base class for documentation. 00084 void end_of_line_inner(); 00085 00086 private: 00087 wide_output::pointer deeper; 00088 00089 int width; 00090 00091 wstring_accumulator buf; 00092 00093 int column; 00094 00095 wide_output_truncate(); 00096 wide_output_truncate(const wide_output_truncate &); 00097 wide_output_truncate &operator=(const wide_output_truncate &); 00098 }; 00099 00100 #endif // LIBAEGIS_WIDE_OUTPUT_TRUNCATE_H