From a793c17b6c1d6b366ec86627a270383f6389d172 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Mon, 31 Jul 2000 22:03:55 +0000 Subject: [PATCH] added binz handler git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7906 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/utils/wxrc/wxrc.cpp | 9 ++++++--- utils/wxrc/wxrc.cpp | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/contrib/utils/wxrc/wxrc.cpp b/contrib/utils/wxrc/wxrc.cpp index f346b485ae..dc063fab06 100644 --- a/contrib/utils/wxrc/wxrc.cpp +++ b/contrib/utils/wxrc/wxrc.cpp @@ -28,6 +28,7 @@ #include "wx/cmdline.h" #include "wx/xml/xml.h" +#include "wx/xml/xmlio.h" #include "wx/ffile.h" /* @@ -76,7 +77,7 @@ int XmlResApp::OnRun() { wxCMD_LINE_SWITCH, "u", "uncompressed", "do not compress .xml files (C++ only)" }, { wxCMD_LINE_OPTION, "n", "function", "C++ function name (with -c) [InitXmlResource]" }, { wxCMD_LINE_OPTION, "o", "output", "output file [resource.rsc/cpp]" }, - { wxCMD_LINE_OPTION, "h", "handlers", "output list of neccessary handlers to this file" }, + { wxCMD_LINE_OPTION, "l", "list-of-handlers", "output list of neccessary handlers to this file" }, { wxCMD_LINE_PARAM, NULL, NULL, "input file", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE }, @@ -84,6 +85,8 @@ int XmlResApp::OnRun() { wxCMD_LINE_NONE } }; + wxXmlDocument::AddHandler(new wxXmlIOHandlerBinZ); + wxCmdLineParser parser(cmdLineDesc, argc, argv); switch (parser.Parse()) @@ -287,7 +290,7 @@ void " + parFuncname + "()\n\ {\n\ wxMemoryFSHandler::AddFile(\"xml_resource/dummy_file\", \"dummy one\");\n\ wxFileSystem fsys;\n\ - wxFSFile *f = fsys.OpenFile(\"xml_resource/dummy_file\");\n\ + wxFSFile *f = fsys.OpenFile(\"memory:xml_resource/dummy_file\");\n\ wxMemoryFSHandler::RemoveFile(\"xml_resource/dummy_file\");\n\ if (f) delete f;\n\ else wxFileSystem::AddHandler(new wxMemoryFSHandler);\n\ @@ -299,7 +302,7 @@ void " + parFuncname + "()\n\ wxString s; s.Printf(" wxMemoryFSHandler::AddFile(\"xml_resource/" + flist[i] + "\", xml_res_file_%i, xml_res_size_%i);\n" - " wxTheXmlResource->Read(\"xml_resource/" + flist[i] + + " wxTheXmlResource->Load(\"memory:xml_resource/" + flist[i] + "\", wxXML_BINARY);\n", i, i); file.Write(s); } diff --git a/utils/wxrc/wxrc.cpp b/utils/wxrc/wxrc.cpp index f346b485ae..dc063fab06 100644 --- a/utils/wxrc/wxrc.cpp +++ b/utils/wxrc/wxrc.cpp @@ -28,6 +28,7 @@ #include "wx/cmdline.h" #include "wx/xml/xml.h" +#include "wx/xml/xmlio.h" #include "wx/ffile.h" /* @@ -76,7 +77,7 @@ int XmlResApp::OnRun() { wxCMD_LINE_SWITCH, "u", "uncompressed", "do not compress .xml files (C++ only)" }, { wxCMD_LINE_OPTION, "n", "function", "C++ function name (with -c) [InitXmlResource]" }, { wxCMD_LINE_OPTION, "o", "output", "output file [resource.rsc/cpp]" }, - { wxCMD_LINE_OPTION, "h", "handlers", "output list of neccessary handlers to this file" }, + { wxCMD_LINE_OPTION, "l", "list-of-handlers", "output list of neccessary handlers to this file" }, { wxCMD_LINE_PARAM, NULL, NULL, "input file", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE }, @@ -84,6 +85,8 @@ int XmlResApp::OnRun() { wxCMD_LINE_NONE } }; + wxXmlDocument::AddHandler(new wxXmlIOHandlerBinZ); + wxCmdLineParser parser(cmdLineDesc, argc, argv); switch (parser.Parse()) @@ -287,7 +290,7 @@ void " + parFuncname + "()\n\ {\n\ wxMemoryFSHandler::AddFile(\"xml_resource/dummy_file\", \"dummy one\");\n\ wxFileSystem fsys;\n\ - wxFSFile *f = fsys.OpenFile(\"xml_resource/dummy_file\");\n\ + wxFSFile *f = fsys.OpenFile(\"memory:xml_resource/dummy_file\");\n\ wxMemoryFSHandler::RemoveFile(\"xml_resource/dummy_file\");\n\ if (f) delete f;\n\ else wxFileSystem::AddHandler(new wxMemoryFSHandler);\n\ @@ -299,7 +302,7 @@ void " + parFuncname + "()\n\ wxString s; s.Printf(" wxMemoryFSHandler::AddFile(\"xml_resource/" + flist[i] + "\", xml_res_file_%i, xml_res_size_%i);\n" - " wxTheXmlResource->Read(\"xml_resource/" + flist[i] + + " wxTheXmlResource->Load(\"memory:xml_resource/" + flist[i] + "\", wxXML_BINARY);\n", i, i); file.Write(s); } -- 2.47.2