DGD Library
Version: 0.1.0.14 | Updated: Thu Aug 10 16:58:23 2006
Home
DGD News
FAQ
Code Documentation
DGD Installation Guide
Bugs-n-Features
DGD at Sourceforge.net
Download DGD
Subversion
Code Documentation
Documentation
Namespaces
Class Hierarchy
Class List
File List
Namespace Members
Functions
Globals
Tutorial
Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

dgChannel.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 //
00003 // 
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 2 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, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 //
00019 // This file is part of Depression Glass library.
00020 //
00021 // Copyright (c) 2002. Dimitry Kloper <kloper@users.sf.net> . 
00022 //
00023 // dgChannel.h -- DGD channel implementation
00024 //
00025 
00026 #ifndef _dgChannel_h_
00027 #define _dgChannel_h_
00028 
00035 #include <iostream>
00036 #include <string>
00037 
00038 #include "dgChannelBuf.h"
00039 
00040 namespace DGD {
00041 
00140 class channel: public std::ostream {
00141    public:
00142       typedef std::ostream Parent;
00143       
00144    public:
00145       channel( const std::string& name );
00146       void               open();
00147       void               close();
00148       bool               is_open() const;
00149       operator           bool () const;
00150       const std::string& name() const;
00151       channelbuf*      rdbuf() const;
00152       channelbuf&      rdbuf();
00153       
00154       void         indent_step( unsigned int step );
00155       unsigned int indent_step() const;
00156       void         incr_indent();
00157       void         decr_indent();
00158       void         indent( unsigned int val );
00159       unsigned int indent() const;
00160       
00161       void         min_width( unsigned int width );
00162       unsigned int min_width() const;
00163       void         max_width( unsigned int width );
00164       unsigned int max_width() const;
00165       
00166       void         wrap( bool allow );
00167       bool         wrap() const;
00168       void         word_wrap( bool allow );
00169       bool         word_wrap() const;
00170       
00171       void         space_chars(const char* spc = " \t");
00172       std::string  space_chars() const;
00173 
00174       virtual void header();
00175 
00176    private:
00177       bool m_is_open;
00178       std::string m_name;
00179       channelbuf m_buffer;
00180       channelbuf m_tmp_buffer;
00181 };
00182 
00183 enum Assoc_type {
00184    Assoc_Append = 0,
00185    Assoc_Assign,
00186    Assoc_Prepend,
00187    Assoc_Delete
00188 };
00189 
00190 void assoc( std::ostream* s, channel& channel, 
00191             const Assoc_type action = Assoc_Append );
00192 void assoc( std::ostream& s, channel& channel, 
00193             const Assoc_type action = Assoc_Append );
00194 
00195 #ifndef DGD_WITHOUT_BOOST
00196 void assoc( std::ostream* s, const std::string& name, 
00197             const Assoc_type action = Assoc_Append );
00198 #endif // DGD_WITHOUT_BOOST
00199 
00200 }; // end of namespace DGD
00201 
00202 #endif /* _dgChannel_h_ */
00203 
00204 /* 
00205  * Local Variables:
00206  * compile-command: "make dgChannel.obj"
00207  * End:
00208  */
00209 
00210 

Generated on Thu Aug 10 16:48:27 2006 for DGD Library by doxygen1.3

SourceForge.net Logo Powered by Mason Powered by Perl
Web design derived from Pasilda design found on www.oswd.org.
Copyright (c) 2002, 2003. Dimitry Kloper <kloper@users.sourceforge.net>