1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxXmlIOHandler - XML I/O classes
4 // Author: Vaclav Slavik
7 // Copyright: (c) 2000 Vaclav Slavik
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
15 #pragma interface "xmlio.h"
19 #include "wx/string.h"
20 #include "wx/xrc/xml.h"
23 class WXXMLDLLEXPORT wxXmlIOHandlerExpat
: public wxXmlIOHandler
26 virtual wxXmlIOType
GetType() { return wxXML_IO_EXPAT
; }
27 virtual bool CanLoad(wxInputStream
& stream
);
28 virtual bool CanSave() { return FALSE
; }
30 virtual bool Load(wxInputStream
& stream
, wxXmlDocument
& doc
,
31 const wxString
& encoding
);
32 virtual bool Save(wxOutputStream
& WXUNUSED(stream
), const wxXmlDocument
& WXUNUSED(doc
))
37 class WXXMLDLLEXPORT wxXmlIOHandlerWriter
: public wxXmlIOHandler
40 virtual wxXmlIOType
GetType() { return wxXML_IO_TEXT_OUTPUT
; }
41 virtual bool CanLoad(wxInputStream
& WXUNUSED(stream
)) { return FALSE
; }
42 virtual bool CanSave() { return TRUE
; }
44 virtual bool Load(wxInputStream
& WXUNUSED(stream
), wxXmlDocument
& WXUNUSED(doc
),
45 const wxString
& WXUNUSED(encoding
))
47 virtual bool Save(wxOutputStream
& stream
, const wxXmlDocument
& doc
);
51 class WXXMLDLLEXPORT wxXmlIOHandlerBin
: public wxXmlIOHandler
54 wxXmlIOHandlerBin() {}
56 virtual wxXmlIOType
GetType() { return wxXML_IO_BIN
; }
57 virtual bool CanLoad(wxInputStream
& stream
);
58 virtual bool CanSave() { return TRUE
; }
60 virtual bool Load(wxInputStream
& stream
, wxXmlDocument
& doc
,
61 const wxString
& encoding
);
62 virtual bool Save(wxOutputStream
& stream
, const wxXmlDocument
& doc
);
65 wxString
ReadHeader(wxInputStream
& stream
);
66 void WriteHeader(wxOutputStream
& stream
, const wxString
& header
);
73 class WXXMLDLLEXPORT wxXmlIOHandlerBinZ
: public wxXmlIOHandlerBin
76 wxXmlIOHandlerBinZ() {}
78 virtual wxXmlIOType
GetType() { return wxXML_IO_BINZ
; }
79 virtual bool CanLoad(wxInputStream
& stream
);
81 virtual bool Load(wxInputStream
& stream
, wxXmlDocument
& doc
,
82 const wxString
& encoding
);
83 virtual bool Save(wxOutputStream
& stream
, const wxXmlDocument
& doc
);
89 #endif // _WX_XMLIO_H_