2 * This library is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU Lesser General Public
4 * License as published by the Free Software Foundation; either
5 * version 2.1 of the License, or (at your option) any later version.
7 * This library is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * Lesser General Public License for more details.
12 * You should have received a copy of the GNU Lesser General Public
13 * License along with this library; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 * binfile.h - Binary file I/O
17 * Copyright (C) 2002, 2003 Simon Peter <dn.tlp@gmx.net>
20 #ifndef H_BINIO_BINFILE
21 #define H_BINIO_BINFILE
27 class binfbase: virtual public binio
40 virtual void open(const char *filename, const Mode mode) = 0;
41 #if BINIO_ENABLE_STRING
42 virtual void open(const std::string &filename, const Mode mode) = 0;
46 virtual void seek(long pos, Offset offs = Set);
53 class binifstream: public binistream, virtual public binfbase
57 binifstream(const char *filename, const Mode mode = NoCreate);
58 #if BINIO_ENABLE_STRING
59 binifstream(const std::string &filename, const Mode mode = NoCreate);
62 virtual ~binifstream();
64 virtual void open(const char *filename, const Mode mode = NoCreate);
65 #if BINIO_ENABLE_STRING
66 virtual void open(const std::string &filename, const Mode mode = NoCreate);
70 virtual Byte getByte();
73 class binofstream: public binostream, virtual public binfbase
77 binofstream(const char *filename, const Mode mode = 0);
78 #if BINIO_ENABLE_STRING
79 binofstream(const std::string &filename, const Mode mode = 0);
82 virtual ~binofstream();
84 virtual void open(const char *filename, const Mode mode = 0);
85 #if BINIO_ENABLE_STRING
86 virtual void open(const std::string &filename, const Mode mode = 0);
90 virtual void putByte(Byte b);
93 class binfstream: public binifstream, public binofstream
97 binfstream(const char *filename, const Mode mode = 0);
98 #if BINIO_ENABLE_STRING
99 binfstream(const std::string &filename, const Mode mode = 0);
102 virtual ~binfstream();
104 virtual void open(const char *filename, const Mode mode = 0);
105 #if BINIO_ENABLE_STRING
106 virtual void open(const std::string &filename, const Mode mode = 0);