]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: xmlio.h | |
3 | // Purpose: wxXmlIOHandler - XML I/O classes | |
4 | // Author: Vaclav Slavik | |
5 | // Created: 2000/07/24 | |
6 | // RCS-ID: $Id$ | |
7 | // Copyright: (c) 2000 Vaclav Slavik | |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef _WX_XMLIO_H_ | |
12 | #define _WX_XMLIO_H_ | |
13 | ||
14 | #ifdef __GNUG__ | |
15 | #pragma interface "xmlio.h" | |
16 | #endif | |
17 | ||
18 | #include "wx/defs.h" | |
19 | #include "wx/string.h" | |
20 | #include "wx/xml/xml.h" | |
21 | ||
22 | ||
23 | class WXDLLEXPORT wxXmlIOHandlerBin : public wxXmlIOHandler | |
24 | { | |
25 | public: | |
26 | wxXmlIOHandlerBin() {} | |
27 | ||
28 | virtual wxXmlIOType GetType() { return wxXML_IO_BIN; } | |
29 | virtual bool CanLoad(wxInputStream& stream); | |
30 | virtual bool CanSave() { return TRUE; } | |
31 | ||
32 | virtual bool Load(wxInputStream& stream, wxXmlDocument& doc); | |
33 | virtual bool Save(wxOutputStream& stream, const wxXmlDocument& doc); | |
34 | ||
35 | protected: | |
36 | wxString ReadHeader(wxInputStream& stream); | |
37 | void WriteHeader(wxOutputStream& stream, const wxString& header); | |
38 | }; | |
39 | ||
40 | ||
41 | ||
42 | #if wxUSE_ZLIB | |
43 | ||
44 | class WXDLLEXPORT wxXmlIOHandlerBinZ : public wxXmlIOHandlerBin | |
45 | { | |
46 | public: | |
47 | wxXmlIOHandlerBinZ() {} | |
48 | ||
49 | virtual wxXmlIOType GetType() { return wxXML_IO_BINZ; } | |
50 | virtual bool CanLoad(wxInputStream& stream); | |
51 | ||
52 | virtual bool Load(wxInputStream& stream, wxXmlDocument& doc); | |
53 | virtual bool Save(wxOutputStream& stream, const wxXmlDocument& doc); | |
54 | }; | |
55 | ||
56 | #endif | |
57 | ||
58 | ||
59 | ||
60 | class WXDLLEXPORT wxXmlIOHandlerLibxml : public wxXmlIOHandler | |
61 | { | |
62 | public: | |
63 | virtual wxXmlIOType GetType() { return wxXML_IO_LIBXML; } | |
64 | virtual bool CanLoad(wxInputStream& stream); | |
65 | virtual bool CanSave(); | |
66 | ||
67 | virtual bool Load(wxInputStream& stream, wxXmlDocument& doc); | |
68 | virtual bool Save(wxOutputStream& stream, const wxXmlDocument& doc); | |
69 | }; | |
70 | ||
71 | ||
72 | #endif // _WX_XMLIO_H_ |