00001 // -*- Mode: C++ -*- 00002 // InputStream.h 00003 // Copyright © 2003 Laboratoire de Biologie Informatique et Théorique 00004 // Université de Montréal. 00005 // Author : Martin Larose 00006 // $Revision: 1.1 $ 00007 // 00008 // This file is part of xmlcpg. 00009 // 00010 // xmlcpg is free software; you can redistribute it and/or modify it under 00011 // the terms of the GNU Lesser General Public License as published by the Free 00012 // Software Foundation; either version 2 of the License, or (at your option) 00013 // any later version. 00014 // 00015 // xmlcpg is distributed in the hope that it will be useful, but WITHOUT ANY 00016 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00017 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 00018 // more details. 00019 // 00020 // You should have received a copy of the GNU Lesser General Public License 00021 // along with xmlcpg; if not, write to the Free Software Foundation, Inc., 00022 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 00024 00025 #ifndef _rnaml_InputStream_h_ 00026 #define _rnaml_InputStream_h_ 00027 00028 extern "C" { 00029 #include "inputstream.h" 00030 } 00031 00032 00033 00034 namespace rnaml 00035 { 00042 class InputStream 00043 { 00044 00045 public: 00046 00047 // LIFECYCLE ------------------------------------------------------------ 00048 00052 virtual ~InputStream (); 00053 00054 // OPERATORS ------------------------------------------------------------ 00055 00056 // ACCESS --------------------------------------------------------------- 00057 00062 virtual xmlcpgInputStream* getCStructure () const = 0; 00063 00068 virtual void setCStructure (xmlcpgInputStream *is) = 0; 00069 00070 // METHODS -------------------------------------------------------------- 00071 00076 virtual bool getEOS () const = 0; 00077 00082 virtual bool getError () const = 0; 00083 00088 virtual const char* getErrorString () const = 0; 00089 00090 // I/O ----------------------------------------------------------------- 00091 00096 virtual int read () = 0; 00097 00104 virtual int read (void *ptr, int size) = 0; 00105 00110 virtual bool close () = 0; 00111 00112 }; 00113 } 00114 00115 #endif