00001 // -*- Mode: C++ -*- 00002 // OutputStream.h 00003 // Copyright © 2003 Laboratoire de Biologie Informatique et Théorique 00004 // Université de Montréal. 00005 // Author : Martin Larose 00006 // Created On : Fri Nov 7 11:25:32 2003 00007 // $Revision: 1.1 $ 00008 // 00009 // This file is part of xmlcpg. 00010 // 00011 // xmlcpg is free software; you can redistribute it and/or modify it under 00012 // the terms of the GNU Lesser General Public License as published by the Free 00013 // Software Foundation; either version 2 of the License, or (at your option) 00014 // any later version. 00015 // 00016 // xmlcpg is distributed in the hope that it will be useful, but WITHOUT ANY 00017 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00018 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 00019 // more details. 00020 // 00021 // You should have received a copy of the GNU Lesser General Public License 00022 // along with xmlcpg; if not, write to the Free Software Foundation, Inc., 00023 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00024 00025 00026 #ifndef _rnaml_OutputStream_h_ 00027 #define _rnaml_OutputStream_h_ 00028 00029 extern "C" { 00030 #include "outputstream.h" 00031 } 00032 00033 00034 00035 namespace rnaml 00036 { 00041 class OutputStream 00042 { 00043 00044 protected: 00045 00049 xmlcpgOutputStream *os; 00050 00051 // LIFECYCLE ------------------------------------------------------------ 00052 00057 OutputStream (xmlcpgOutputStream *cos) : os (cos) { } 00058 00059 public: 00060 00064 virtual ~OutputStream (); 00065 00066 // OPERATORS ------------------------------------------------------------ 00067 00068 // ACCESS --------------------------------------------------------------- 00069 00074 xmlcpgOutputStream* getCStructure () const { return os; } 00075 00080 void setCStructure (xmlcpgOutputStream *is); 00081 00082 // METHODS -------------------------------------------------------------- 00083 00088 virtual bool getEOS () const; 00089 00094 virtual bool getError () const; 00095 00100 virtual const char* getErrorString () const; 00101 00102 // I/O ----------------------------------------------------------------- 00103 00108 virtual bool flush (); 00109 00116 virtual int write (int c); 00117 00124 virtual int write (const void *ptr, int nb); 00125 00130 virtual bool close (); 00131 00132 }; 00133 } 00134 00135 #endif