1
/***************************************************************************
2
* Copyright (c) 2007 Werner Mayer <werner.wm.mayer@gmx.de> *
4
* This file is part of the FreeCAD CAx development system. *
6
* This library is free software; you can redistribute it and/or *
7
* modify it under the terms of the GNU Library General Public *
8
* License as published by the Free Software Foundation; either *
9
* version 2 of the License, or (at your option) any later version. *
11
* This library is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
* GNU Library General Public License for more details. *
16
* You should have received a copy of the GNU Library General Public *
17
* License along with this library; see the file COPYING.LIB. If not, *
18
* write to the Free Software Foundation, Inc., 59 Temple Place, *
19
* Suite 330, Boston, MA 02111-1307, USA *
21
***************************************************************************/
37
class BaseExport Stream
40
enum ByteOrder { BigEndian, LittleEndian };
42
ByteOrder byteOrder() const;
43
void setByteOrder(ByteOrder);
53
* The OutputStream class provides writing of binary data to an ostream.
54
* @author Werner Mayer
56
class BaseExport OutputStream : public Stream
59
OutputStream(std::ostream &rout);
62
OutputStream& operator << (bool b);
63
OutputStream& operator << (int8_t ch);
64
OutputStream& operator << (uint8_t uch);
65
OutputStream& operator << (int16_t s);
66
OutputStream& operator << (uint16_t us);
67
OutputStream& operator << (int32_t i);
68
OutputStream& operator << (uint32_t ui);
69
OutputStream& operator << (int64_t l);
70
OutputStream& operator << (uint64_t ul);
71
OutputStream& operator << (float f);
72
OutputStream& operator << (double d);
75
OutputStream (const OutputStream&);
76
void operator = (const OutputStream&);
83
* The InputStream class provides reading of binary data from an istream.
84
* @author Werner Mayer
86
class BaseExport InputStream : public Stream
89
InputStream(std::istream &rin);
92
InputStream& operator >> (bool& b);
93
InputStream& operator >> (int8_t& ch);
94
InputStream& operator >> (uint8_t& uch);
95
InputStream& operator >> (int16_t& s);
96
InputStream& operator >> (uint16_t& us);
97
InputStream& operator >> (int32_t& i);
98
InputStream& operator >> (uint32_t& ui);
99
InputStream& operator >> (int64_t& l);
100
InputStream& operator >> (uint64_t& ul);
101
InputStream& operator >> (float& f);
102
InputStream& operator >> (double& d);
104
operator bool() const
105
{ // test if _Ipfx succeeded
110
InputStream (const InputStream&);
111
void operator = (const InputStream&);
117
// ----------------------------------------------------------------------------
122
* The ofstream class is provided for convenience. On Windows
123
* platforms it opens a stream with UCS-2 encoded file name
124
* while on Linux platforms the file name is UTF-8 encoded.
125
* @author Werner Mayer
127
class BaseExport ofstream : public std::ofstream
130
ofstream(const FileInfo& fi, ios_base::openmode mode =
131
std::ios::out | std::ios::trunc);
136
* The ofstream class is provided for convenience. On Windows
137
* platforms it opens a stream with UCS-2 encoded file name
138
* while on Linux platforms the file name is UTF-8 encoded.
139
* @author Werner Mayer
141
class BaseExport ifstream : public std::ifstream
144
ifstream(const FileInfo& fi, ios_base::openmode mode =
151
#endif // BASE_STREAM_H