X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ca7408bd9ab49ba525517eb03c6b861c850c3199..56d2f75071fc2a29ec10abe97c5a908bb35f30f4:/contrib/src/xml/xmlbinz.cpp diff --git a/contrib/src/xml/xmlbinz.cpp b/contrib/src/xml/xmlbinz.cpp new file mode 100644 index 0000000000..a65d81bd99 --- /dev/null +++ b/contrib/src/xml/xmlbinz.cpp @@ -0,0 +1,59 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: xmlbinz.cpp +// Purpose: wxXmlIOHandlerBinZ +// Author: Vaclav Slavik +// Created: 2000/07/24 +// RCS-ID: $Id$ +// Copyright: (c) 2000 Vaclav Slavik +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifdef __GNUG__ +// nothing, already in xml.cpp +#endif + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/datstrm.h" +#include "wx/log.h" +#include "wx/zstream.h" + +#include "wx/xml/xmlio.h" + +#if wxUSE_ZLIB + + + +bool wxXmlIOHandlerBinZ::CanLoad(wxInputStream& stream) +{ + bool canread; + canread = (ReadHeader(stream) == _T("XMLBINZ")); + stream.SeekI(-9, wxFromCurrent); + return canread; +} + + + +bool wxXmlIOHandlerBinZ::Save(wxOutputStream& stream, const wxXmlDocument& doc) +{ + WriteHeader(stream, "XMLBINZ"); + wxZlibOutputStream costr(stream, 9); + return wxXmlIOHandlerBin::Save(costr, doc); +} + + + +bool wxXmlIOHandlerBinZ::Load(wxInputStream& stream, wxXmlDocument& doc) +{ + ReadHeader(stream); + wxZlibInputStream costr(stream); + return wxXmlIOHandlerBin::Load(stream, doc); +} + + +#endif