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_OUTPUT_INDENT_H 00021 #define LIBAEGIS_OUTPUT_INDENT_H 00022 00023 #include <libaegis/output.h> 00024 00029 class output_indent: 00030 public output 00031 { 00032 public: 00033 typedef aegis_shared_ptr<output_indent> ipointer; 00034 00038 virtual ~output_indent(); 00039 00040 private: 00048 output_indent(const output::pointer &deeper); 00049 00050 public: 00058 static ipointer create(const output::pointer &deeper); 00059 00067 void indent_more(); 00068 00076 void indent_less(); 00077 00078 protected: 00079 // See base class for documentation. 00080 nstring filename() const; 00081 00082 // See base class for documentation. 00083 const char *type_name() const; 00084 00085 // See base class for documentation. 00086 long ftell_inner() const; 00087 00088 // See base class for documentation. 00089 void write_inner(const void *data, size_t length); 00090 00091 // See base class for documentation. 00092 void end_of_line_inner(); 00093 00094 // See base class for documentation. 00095 int page_width() const; 00096 00097 // See base class for documentation. 00098 int page_length() const; 00099 00100 private: 00101 enum { 00105 INDENT = 8 00106 }; 00107 00112 output::pointer deeper; 00113 00118 int depth; 00119 00125 int in_col; 00126 00131 int out_col; 00132 00140 int continuation_line; 00141 00146 long pos; 00147 00151 output_indent(); 00152 00156 output_indent(const output_indent &); 00157 00161 output_indent &operator=(const output_indent &); 00162 }; 00163 00164 #endif // LIBAEGIS_OUTPUT_INDENT_H