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/xml/xml.h"
23 class WXDLLEXPORT 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 virtual bool Save(wxOutputStream
& stream
, const wxXmlDocument
& doc
) { return FALSE
; }
35 class WXDLLEXPORT wxXmlIOHandlerWriter
: public wxXmlIOHandler
38 virtual wxXmlIOType
GetType() { return wxXML_IO_TEXT_OUTPUT
; }
39 virtual bool CanLoad(wxInputStream
& stream
) { return FALSE
; }
40 virtual bool CanSave() { return TRUE
; }
42 virtual bool Load(wxInputStream
& stream
, wxXmlDocument
& doc
) { return FALSE
; }
43 virtual bool Save(wxOutputStream
& stream
, const wxXmlDocument
& doc
);
47 class WXDLLEXPORT wxXmlIOHandlerBin
: public wxXmlIOHandler
50 wxXmlIOHandlerBin() {}
52 virtual wxXmlIOType
GetType() { return wxXML_IO_BIN
; }
53 virtual bool CanLoad(wxInputStream
& stream
);
54 virtual bool CanSave() { return TRUE
; }
56 virtual bool Load(wxInputStream
& stream
, wxXmlDocument
& doc
);
57 virtual bool Save(wxOutputStream
& stream
, const wxXmlDocument
& doc
);
60 wxString
ReadHeader(wxInputStream
& stream
);
61 void WriteHeader(wxOutputStream
& stream
, const wxString
& header
);
68 class WXDLLEXPORT wxXmlIOHandlerBinZ
: public wxXmlIOHandlerBin
71 wxXmlIOHandlerBinZ() {}
73 virtual wxXmlIOType
GetType() { return wxXML_IO_BINZ
; }
74 virtual bool CanLoad(wxInputStream
& stream
);
76 virtual bool Load(wxInputStream
& stream
, wxXmlDocument
& doc
);
77 virtual bool Save(wxOutputStream
& stream
, const wxXmlDocument
& doc
);
83 #endif // _WX_XMLIO_H_