column_headers.h

Go to the documentation of this file.
00001 #ifndef COLUMN_HEADERS_CLASS
00002 #define COLUMN_HEADERS_CLASS
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : column_headers                                                    *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 2000-$now By Author.  This program is free software; you can  *
00011 * redistribute it and/or modify it under the terms of the GNU General Public  *
00012 * License as published by the Free Software Foundation; either version 2 of   *
00013 * the License or (at your option) any later version.  This is online at:      *
00014 *     http://www.fsf.org/copyleft/gpl.html                                    *
00015 * Please send any updates to: fred@gruntose.com                               *
00016 \*****************************************************************************/
00017 
00018 #include "textual_dll.h"
00019 
00020 #include <basis/packable.h>
00021 
00022 // forward.
00023 class column_info_array;
00024 class string_matrix;
00025 
00027 
00032 class TEXTUAL_CLASS_STYLE column_headers : public packable
00033 {
00034 public:
00035   column_headers();
00036   virtual ~column_headers();
00037 
00038   int columns() const;
00040 
00041   enum justifications { LEFT_JUSTIFY, CENTER_JUSTIFY, RIGHT_JUSTIFY };
00042 
00043   void add(const istring &column_name, justifications placement = LEFT_JUSTIFY,
00044           int maximum_width = 0);
00046 
00050   bool get(int index, istring &column_name, justifications &placement,
00051           int &maximum_width);
00053 
00054   bool zap(int start, int end = -1);
00056 
00059   bool format(istring &to_fill, const string_array &to_format);
00061 
00068   bool format(istring &to_fill, const string_matrix &to_format);
00070 
00076   virtual void pack(byte_array &packed_form) const;
00078   virtual bool unpack(byte_array &packed_form);
00080 
00081 private:
00082   column_info_array *_cols;  
00083 };
00084 
00085 #endif
00086 

Generated on Fri Nov 28 04:29:33 2008 for HOOPLE Libraries by  doxygen 1.5.1