2000-07-25 14:47:21 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: xmlio.h
|
|
|
|
// Purpose: wxXmlIOHandler - XML I/O classes
|
|
|
|
// Author: Vaclav Slavik
|
|
|
|
// Created: 2000/07/24
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) 2000 Vaclav Slavik
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_XMLIO_H_
|
|
|
|
#define _WX_XMLIO_H_
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface "xmlio.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
#include "wx/string.h"
|
2001-06-09 18:18:45 -04:00
|
|
|
#include "wx/xrc/xml.h"
|
2000-07-25 14:47:21 -04:00
|
|
|
|
|
|
|
|
2001-06-05 18:03:02 -04:00
|
|
|
class WXXMLDLLEXPORT wxXmlIOHandlerExpat : public wxXmlIOHandler
|
2000-07-25 14:47:21 -04:00
|
|
|
{
|
2001-05-02 19:01:00 -04:00
|
|
|
public:
|
|
|
|
virtual wxXmlIOType GetType() { return wxXML_IO_EXPAT; }
|
|
|
|
virtual bool CanLoad(wxInputStream& stream);
|
|
|
|
virtual bool CanSave() { return FALSE; }
|
|
|
|
|
|
|
|
virtual bool Load(wxInputStream& stream, wxXmlDocument& doc);
|
2001-06-09 18:18:45 -04:00
|
|
|
virtual bool Save(wxOutputStream& WXUNUSED(stream), const wxXmlDocument& WXUNUSED(doc))
|
|
|
|
{ return FALSE; }
|
2000-07-25 14:47:21 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-06-05 18:03:02 -04:00
|
|
|
class WXXMLDLLEXPORT wxXmlIOHandlerWriter : public wxXmlIOHandler
|
2001-05-02 19:01:00 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual wxXmlIOType GetType() { return wxXML_IO_TEXT_OUTPUT; }
|
2001-06-09 18:18:45 -04:00
|
|
|
virtual bool CanLoad(wxInputStream& WXUNUSED(stream)) { return FALSE; }
|
2001-05-02 19:01:00 -04:00
|
|
|
virtual bool CanSave() { return TRUE; }
|
2000-07-25 14:47:21 -04:00
|
|
|
|
2001-06-09 18:18:45 -04:00
|
|
|
virtual bool Load(wxInputStream& WXUNUSED(stream), wxXmlDocument& WXUNUSED(doc))
|
|
|
|
{ return FALSE; }
|
2001-05-02 19:01:00 -04:00
|
|
|
virtual bool Save(wxOutputStream& stream, const wxXmlDocument& doc);
|
|
|
|
};
|
2000-07-25 14:47:21 -04:00
|
|
|
|
2001-05-02 19:01:00 -04:00
|
|
|
|
2001-06-05 18:03:02 -04:00
|
|
|
class WXXMLDLLEXPORT wxXmlIOHandlerBin : public wxXmlIOHandler
|
2000-07-25 14:47:21 -04:00
|
|
|
{
|
2001-05-02 19:01:00 -04:00
|
|
|
public:
|
|
|
|
wxXmlIOHandlerBin() {}
|
2000-07-25 14:47:21 -04:00
|
|
|
|
2001-05-02 19:01:00 -04:00
|
|
|
virtual wxXmlIOType GetType() { return wxXML_IO_BIN; }
|
|
|
|
virtual bool CanLoad(wxInputStream& stream);
|
|
|
|
virtual bool CanSave() { return TRUE; }
|
2000-07-25 14:47:21 -04:00
|
|
|
|
2001-05-02 19:01:00 -04:00
|
|
|
virtual bool Load(wxInputStream& stream, wxXmlDocument& doc);
|
|
|
|
virtual bool Save(wxOutputStream& stream, const wxXmlDocument& doc);
|
|
|
|
|
2001-06-05 18:03:02 -04:00
|
|
|
protected:
|
2001-05-02 19:01:00 -04:00
|
|
|
wxString ReadHeader(wxInputStream& stream);
|
|
|
|
void WriteHeader(wxOutputStream& stream, const wxString& header);
|
2000-07-25 14:47:21 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-05-02 19:01:00 -04:00
|
|
|
#if wxUSE_ZLIB
|
2000-07-25 14:47:21 -04:00
|
|
|
|
2001-06-05 18:03:02 -04:00
|
|
|
class WXXMLDLLEXPORT wxXmlIOHandlerBinZ : public wxXmlIOHandlerBin
|
2000-07-25 14:47:21 -04:00
|
|
|
{
|
2001-05-02 19:01:00 -04:00
|
|
|
public:
|
|
|
|
wxXmlIOHandlerBinZ() {}
|
2000-07-25 14:47:21 -04:00
|
|
|
|
2001-05-02 19:01:00 -04:00
|
|
|
virtual wxXmlIOType GetType() { return wxXML_IO_BINZ; }
|
|
|
|
virtual bool CanLoad(wxInputStream& stream);
|
|
|
|
|
|
|
|
virtual bool Load(wxInputStream& stream, wxXmlDocument& doc);
|
|
|
|
virtual bool Save(wxOutputStream& stream, const wxXmlDocument& doc);
|
2000-07-25 14:47:21 -04:00
|
|
|
};
|
|
|
|
|
2001-05-02 19:01:00 -04:00
|
|
|
#endif
|
|
|
|
|
2000-07-25 14:47:21 -04:00
|
|
|
|
|
|
|
#endif // _WX_XMLIO_H_
|