]> git.saurik.com Git - wxWidgets.git/commitdiff
fix wxrc-generated c++ code to work in Unicode mode (patch #704064)
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 16 Mar 2003 20:27:15 +0000 (20:27 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 16 Mar 2003 20:27:15 +0000 (20:27 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19586 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

contrib/utils/wxrc/wxrc.cpp
utils/wxrc/wxrc.cpp

index c2aeec7a7edaa021fa3be095dd9f9960273094ee..349a00321aeb41075ef753b52bb832d3ca6ba339 100644 (file)
@@ -370,7 +370,7 @@ static wxString FileToCppArray(wxString filename, int num)
     wxString output;
     wxString tmp;
     wxString snum;
-    wxFFile file(filename, "rb");
+    wxFFile file(filename, wxT("rb"));
     size_t lng = file.Length();
     
     snum.Printf(_T("%i"), num);
@@ -405,7 +405,7 @@ static wxString FileToCppArray(wxString filename, int num)
 
 void XmlResApp::MakePackageCPP(const wxArrayString& flist)
 {
-    wxFFile file(parOutput, "wt");
+    wxFFile file(parOutput, wxT("wt"));
     size_t i;
 
     if (flagVerbose) 
@@ -436,15 +436,15 @@ _T("\n"));
               FileToCppArray(parOutputPath + wxFILE_SEP_PATH + flist[i], i));
     
     file.Write(_T("")
-_T("void " + parFuncname + "()\n")
+_T("void ") + parFuncname + wxT("()\n")
 _T("{\n")
 _T("\n")
 _T("    // Check for memory FS. If not present, load the handler:\n")
 _T("    {\n")
-_T("        wxMemoryFSHandler::AddFile(\"XRC_resource/dummy_file\", \"dummy one\");\n")
+_T("        wxMemoryFSHandler::AddFile(wxT(\"XRC_resource/dummy_file\"), wxT(\"dummy one\"));\n")
 _T("        wxFileSystem fsys;\n")
-_T("        wxFSFile *f = fsys.OpenFile(\"memory:XRC_resource/dummy_file\");\n")
-_T("        wxMemoryFSHandler::RemoveFile(\"XRC_resource/dummy_file\");\n")
+_T("        wxFSFile *f = fsys.OpenFile(wxT(\"memory:XRC_resource/dummy_file\"));\n")
+_T("        wxMemoryFSHandler::RemoveFile(wxT(\"XRC_resource/dummy_file\"));\n")
 _T("        if (f) delete f;\n")
 _T("        else wxFileSystem::AddHandler(new wxMemoryFSHandler);\n")
 _T("    }\n")
@@ -453,15 +453,15 @@ _T("\n"));
     for (i = 0; i < flist.Count(); i++)
     {
         wxString s;
-        s.Printf(_T("    wxMemoryFSHandler::AddFile(\"XRC_resource/") + flist[i] +
-                 _T("\", xml_res_file_%i, xml_res_size_%i);\n"), i, i);
+        s.Printf(_T("    wxMemoryFSHandler::AddFile(wxT(\"XRC_resource/") + flist[i] +
+                 _T("\"), xml_res_file_%i, xml_res_size_%i);\n"), i, i);
         file.Write(s);
     }
 
     for (i = 0; i < parFiles.Count(); i++)
     {
-        file.Write(_T("    wxXmlResource::Get()->Load(\"memory:XRC_resource/") + 
-                   GetInternalFileName(parFiles[i], flist) + _T("\");\n"));
+        file.Write(_T("    wxXmlResource::Get()->Load(wxT(\"memory:XRC_resource/") +
+                   GetInternalFileName(parFiles[i], flist) + _T("\"));\n"));
     }
     
     file.Write(_T("}\n"));
@@ -474,7 +474,7 @@ static wxString FileToPythonArray(wxString filename, int num)
     wxString output;
     wxString tmp;
     wxString snum;
-    wxFFile file(filename, "rb");
+    wxFFile file(filename, wxT("rb"));
     size_t lng = file.Length();
     
     snum.Printf(_T("%i"), num);
@@ -516,7 +516,7 @@ static wxString FileToPythonArray(wxString filename, int num)
 
 void XmlResApp::MakePackagePython(const wxArrayString& flist)
 {
-    wxFFile file(parOutput, "wt");
+    wxFFile file(parOutput, wxT("wt"));
     size_t i;
 
     if (flagVerbose) 
@@ -553,7 +553,7 @@ void XmlResApp::OutputGettext()
     
     wxFFile fout;
     if (!parOutput) fout.Attach(stdout);
-    else fout.Open(parOutput, "wt");
+    else fout.Open(parOutput, wxT("wt"));
     
     for (size_t i = 0; i < str.GetCount(); i++)
         fout.Write(_T("_(\"") + str[i] + _T("\");\n"));
index c2aeec7a7edaa021fa3be095dd9f9960273094ee..349a00321aeb41075ef753b52bb832d3ca6ba339 100644 (file)
@@ -370,7 +370,7 @@ static wxString FileToCppArray(wxString filename, int num)
     wxString output;
     wxString tmp;
     wxString snum;
-    wxFFile file(filename, "rb");
+    wxFFile file(filename, wxT("rb"));
     size_t lng = file.Length();
     
     snum.Printf(_T("%i"), num);
@@ -405,7 +405,7 @@ static wxString FileToCppArray(wxString filename, int num)
 
 void XmlResApp::MakePackageCPP(const wxArrayString& flist)
 {
-    wxFFile file(parOutput, "wt");
+    wxFFile file(parOutput, wxT("wt"));
     size_t i;
 
     if (flagVerbose) 
@@ -436,15 +436,15 @@ _T("\n"));
               FileToCppArray(parOutputPath + wxFILE_SEP_PATH + flist[i], i));
     
     file.Write(_T("")
-_T("void " + parFuncname + "()\n")
+_T("void ") + parFuncname + wxT("()\n")
 _T("{\n")
 _T("\n")
 _T("    // Check for memory FS. If not present, load the handler:\n")
 _T("    {\n")
-_T("        wxMemoryFSHandler::AddFile(\"XRC_resource/dummy_file\", \"dummy one\");\n")
+_T("        wxMemoryFSHandler::AddFile(wxT(\"XRC_resource/dummy_file\"), wxT(\"dummy one\"));\n")
 _T("        wxFileSystem fsys;\n")
-_T("        wxFSFile *f = fsys.OpenFile(\"memory:XRC_resource/dummy_file\");\n")
-_T("        wxMemoryFSHandler::RemoveFile(\"XRC_resource/dummy_file\");\n")
+_T("        wxFSFile *f = fsys.OpenFile(wxT(\"memory:XRC_resource/dummy_file\"));\n")
+_T("        wxMemoryFSHandler::RemoveFile(wxT(\"XRC_resource/dummy_file\"));\n")
 _T("        if (f) delete f;\n")
 _T("        else wxFileSystem::AddHandler(new wxMemoryFSHandler);\n")
 _T("    }\n")
@@ -453,15 +453,15 @@ _T("\n"));
     for (i = 0; i < flist.Count(); i++)
     {
         wxString s;
-        s.Printf(_T("    wxMemoryFSHandler::AddFile(\"XRC_resource/") + flist[i] +
-                 _T("\", xml_res_file_%i, xml_res_size_%i);\n"), i, i);
+        s.Printf(_T("    wxMemoryFSHandler::AddFile(wxT(\"XRC_resource/") + flist[i] +
+                 _T("\"), xml_res_file_%i, xml_res_size_%i);\n"), i, i);
         file.Write(s);
     }
 
     for (i = 0; i < parFiles.Count(); i++)
     {
-        file.Write(_T("    wxXmlResource::Get()->Load(\"memory:XRC_resource/") + 
-                   GetInternalFileName(parFiles[i], flist) + _T("\");\n"));
+        file.Write(_T("    wxXmlResource::Get()->Load(wxT(\"memory:XRC_resource/") +
+                   GetInternalFileName(parFiles[i], flist) + _T("\"));\n"));
     }
     
     file.Write(_T("}\n"));
@@ -474,7 +474,7 @@ static wxString FileToPythonArray(wxString filename, int num)
     wxString output;
     wxString tmp;
     wxString snum;
-    wxFFile file(filename, "rb");
+    wxFFile file(filename, wxT("rb"));
     size_t lng = file.Length();
     
     snum.Printf(_T("%i"), num);
@@ -516,7 +516,7 @@ static wxString FileToPythonArray(wxString filename, int num)
 
 void XmlResApp::MakePackagePython(const wxArrayString& flist)
 {
-    wxFFile file(parOutput, "wt");
+    wxFFile file(parOutput, wxT("wt"));
     size_t i;
 
     if (flagVerbose) 
@@ -553,7 +553,7 @@ void XmlResApp::OutputGettext()
     
     wxFFile fout;
     if (!parOutput) fout.Attach(stdout);
-    else fout.Open(parOutput, "wt");
+    else fout.Open(parOutput, wxT("wt"));
     
     for (size_t i = 0; i < str.GetCount(); i++)
         fout.Write(_T("_(\"") + str[i] + _T("\");\n"));