Aegis  4.25.D505
/home/archives/aegis/branch.4/branch.25/delta28933.505/libaegis/wide_output/column.h
Go to the documentation of this file.
00001 //
00002 //      aegis - project change supervisor
00003 //      Copyright (C) 1999, 2002, 2004-2006, 2008, 2012 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_COLUMN_H
00021 #define LIBAEGIS_WIDE_OUTPUT_COLUMN_H
00022 
00023 #include <libaegis/wide_output.h>
00024 
00025 struct column_row_ty
00026 {
00027     size_t length_max;
00028     size_t length;
00029     wchar_t *text;
00030     int printing_width;
00031 };
00032 
00040 class wide_output_column:
00041     public wide_output
00042 {
00043 public:
00044     typedef aegis_shared_ptr<wide_output_column> cpointer;
00045 
00049     virtual ~wide_output_column();
00050 
00051 private:
00056     wide_output_column(int width, int length);
00057 
00058 public:
00068     static cpointer open(int width, int length);
00069 
00070     column_row_ty *get(int n);
00071 
00072     void clear_buffers();
00073 
00074 protected:
00075     // See base class for documentation.
00076     nstring filename();
00077 
00078     // See base class for documentation.
00079     int page_width();
00080 
00081     // See base class for documentation.
00082     int page_length();
00083 
00084     // See base class for documentation.
00085     const char *type_name() const;
00086 
00087     // See base class for documentation.
00088     void write_inner(const wchar_t *data, size_t len);
00089 
00090     // See base class for documentation.
00091     void flush_inner();
00092 
00093     // See base class for documentation.
00094     void end_of_line_inner();
00095 
00096 private:
00097     int width;
00098     int length;
00099 
00100     column_row_ty *row;
00101     size_t nrows;
00102     size_t nrows_max;
00103 
00107     wide_output_column();
00108 
00109     wide_output_column(const wide_output_column &);
00110 
00111     wide_output_column &operator=(const wide_output_column &);
00112 };
00113 
00114 #endif // LIBAEGIS_WIDE_OUTPUT_COLUMN_H
00115 // vim: set ts=8 sw=4 et :