]> git.tdb.fi Git - libs/datafile.git/blob - source/output.cpp
Make Loader a virtual base of ObjectLoader to permit diamond inheritance
[libs/datafile.git] / source / output.cpp
1 #include <msp/io/zlibcompressed.h>
2 #include "output.h"
3
4 using namespace std;
5
6 namespace Msp {
7 namespace DataFile {
8
9 Output::Output(IO::Base &o):
10         out(&o),
11         compressed(0)
12 { }
13
14 Output::~Output()
15 {
16         delete compressed;
17 }
18
19 void Output::set_compressed()
20 {
21         compressed = new IO::ZlibCompressed(*out, IO::M_WRITE);
22         out = compressed;
23 }
24
25 unsigned Output::put(char c)
26 {
27         return out->put(c);
28 }
29
30 unsigned Output::write(const string &s)
31 {
32         return out->write(s);
33 }
34
35 } // namespace DataFile
36 } // namespace Msp