Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
BufferedInStream.h
1 /*
2  * $Id$
3  * BufferedInStream class interface
4  *
5  * This file is part of OTAWA
6  * Copyright (c) 2008, IRIT UPS.
7  *
8  * OTAWA is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * OTAWA is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with OTAWA; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 #ifndef ELM_BUFFEREDINSTREAM_H_
23 #define ELM_BUFFEREDINSTREAM_H_
24 
25 #include <elm/io/InStream.h>
26 
27 namespace elm { namespace io {
28 
29 // BufferedInStream class
30 class BufferedInStream: public InStream {
31 public:
32  static const int default_size = 4096;
33 
35  virtual ~BufferedInStream(void);
36  virtual int read(void *buffer, int size);
37 
38 private:
39  InStream& in;
40  char *buf;
41  int pos, top, buf_size;
42 };
43 
44 } } // elm::io
45 
46 #endif /* ELM_BUFFEREDINSTREAM_H_ */
static const int default_size
Definition: BufferedInStream.h:32
BufferedInStream(InStream &input, int size=default_size)
Definition: io_BufferedInStream.cpp:45
uint32 size
Definition: int.h:41
virtual int read(void)
Definition: io_InStream.cpp:61
virtual ~BufferedInStream(void)
Definition: io_BufferedInStream.cpp:53
Definition: BufferedInStream.h:30
Definition: InStream.h:30