2 // Copyright (C) 2007 by Martin Moracek
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 2 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
37 * names of public methods follow STL naming convention
39 class FileIStream
: public std::istream
{
42 FileIStream(const std::string
& filename
,
43 std::ios_base::openmode mode
=std::ios_base::binary
);
46 bool open(const std::string
& filename
,
47 std::ios_base::openmode mode
=std::ios_base::binary
);
51 bool is_open(void) const;
53 ulong
length(void) const;
55 int iformat(const char * fmt
, ...);
58 class FileOStream
: public std::ostream
{
61 FileOStream(const std::string
& filename
,
62 std::ios_base::openmode mode
=std::ios_base::binary
63 | std::ios_base::trunc
);
66 bool open(const std::string
& filename
,
67 std::ios_base::openmode mode
=std::ios_base::binary
68 | std::ios_base::trunc
);
72 bool is_open(void) const;
74 ulong
length(void) const;
76 int oformat(const char * fmt
, ...);
79 class FileIOStream
: public std::iostream
{
82 FileIOStream(const std::string
& filename
,
83 std::ios_base::openmode mode
=std::ios_base::binary
87 bool open(const std::string
& filename
,
88 std::ios_base::openmode mode
=std::ios_base::binary
93 bool is_open(void) const;
95 ulong
length(void) const;
97 int iformat(const char * fmt
, ...);
98 int oformat(const char * fmt
, ...);
102 * FileBuffer interface
104 class FileBuffer
: public std::streambuf
{
106 virtual ulong
GetSize(void) const = 0;