OSDN Git Service

Unicode版のW系APIに対応。
authorsirakaba <sirakaba@9df91469-1e22-0410-86e7-ea8537beb833>
Mon, 20 Sep 2010 03:06:03 +0000 (03:06 +0000)
committersirakaba <sirakaba@9df91469-1e22-0410-86e7-ea8537beb833>
Mon, 20 Sep 2010 03:06:03 +0000 (03:06 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/tpi/tpi@317 9df91469-1e22-0410-86e7-ea8537beb833

bin/lib/calLibrary.xml
doc/history.html
src/common/library/library.cpp
src/common/library/library.h
src/plugin/calLibrary/calLibrary.cpp

index b4af856..d944cf3 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <libraries>
- <library name="unlha32.dll" prefix="Unlha" unicode="0" typename="Lzh" suffix="lzh;lha;lzs"
+ <library name="unlha32.dll" prefix="Unlha" unicode="1" typename="Lzh" suffix="lzh;lha;lzs"
         sfx     ='s -n -gw4 "-gr%93" --3 "%90" "%91"'
         create  ='a -n -r2 -a1 -x%a0 %a1{-gw3|} --3 "%90" "%91" "@%92"'
         add     ='a -n -r2 -a1 -x%a0 --3 "%90" "%91" "@%92"'
@@ -43,7 +43,7 @@
  <library name="UnAceV2J.dll" prefix="UnAce" typename="Ace" quote-resp="0"
         extract ='%a0{x|e} --hide %a5{"-p#"|} "%90" "%91" "@%92"'
         test    ='t --hide "%90" "@%92"' />
- <library name="unarj32j.dll" prefix="Unarj" typename="Arj" unicode="0"
+ <library name="unarj32j.dll" prefix="Unarj" typename="Arj" unicode="1"
         extract ='%a0{x|e} -i -!@ -- "%90" "%91" "@%92"'
         test    ='t -i -- "%90" "@%92"' />
  <library name="yz1.dll" prefix="Yz1" typename="Yz1" suffix="yz1"
index aa21700..2700a94 100644 (file)
@@ -53,6 +53,7 @@
      <dt>calLibrary</dt>\r
      <dd>\r
       <ul>\r
+       <li class="add">Unicode版のW系APIに対応。</li>\r
        <li class="fix">作業ディレクトリからライブラリを読み込まないよう修正。</li>\r
       </ul>\r
      </dd>\r
index 46d7939..f2da980 100644 (file)
@@ -137,10 +137,10 @@ wxString MakeCommandLineSend(wxString szCommandLine, wxString szArcName, TPI_SWI
        return szCommandLineSend;\r
 }\r
 \r
-wxString MakeResponceFile(wxArrayString asFiles, bool bQuote)\r
+wxString MakeResponceFile(wxArrayString asFiles, bool bQuote, bool bUnicode)\r
 {\r
        wxFile fListFile;\r
-       wxString szFileName = wxFileName::CreateTempFileName(wxT("__listfile"), & fListFile);\r
+       wxString szFileName = wxFileName::CreateTempFileName(wxT("__listfile"), & fListFile), szBuffer;\r
        if (szFileName.IsEmpty())\r
        {\r
                return wxEmptyString;\r
@@ -149,11 +149,10 @@ wxString MakeResponceFile(wxArrayString asFiles, bool bQuote)
        // ファイルリスト書き込み処理。\r
        if (asFiles.IsEmpty())\r
        {\r
-               fListFile.Write(wxT("*"));\r
+               szBuffer = wxT("*");\r
        }\r
        else\r
        {\r
-               wxString szBuffer;\r
                for (size_t i = 0; i < asFiles.GetCount(); i++)\r
                {\r
                        // 最後に改行があると動作がおかしくなる場合がある模様。\r
@@ -167,8 +166,8 @@ wxString MakeResponceFile(wxArrayString asFiles, bool bQuote)
                        }\r
                        szBuffer += bQuote ? (wxT("\"") + asFiles[i] + wxT("\"")) : asFiles[i];\r
                }\r
-               fListFile.Write(szBuffer);\r
        }\r
+       fListFile.Write(szBuffer, bUnicode ? (const wxMBConv&) wxMBConvUTF16LE() : (const wxMBConv&) wxMBConvUTF8());\r
        fListFile.Close();\r
 \r
        return szFileName;\r
index d8d73e3..2279d74 100644 (file)
@@ -31,7 +31,7 @@
 //******************************************************************************\r
 \r
 wxString MakeCommandLineSend(wxString szCommandLine, wxString szArcName, TPI_SWITCHES * swInfo, wxArrayString asFiles, wxString szResponceFileName);\r
-wxString MakeResponceFile(wxArrayString asFiles, bool bQuote);\r
+wxString MakeResponceFile(wxArrayString asFiles, bool bQuote, bool bUnicode = false);\r
 wxString MB2String(const char * sz);\r
 wxString UTF82String(const char * sz);\r
 wxString WC2String(const wchar_t * sz);\r
index a2eb3b2..1911d1a 100644 (file)
@@ -860,7 +860,9 @@ int __stdcall Command
 \r
        // コマンドライン・レスポンスファイル作成。\r
        wxString\r
-               szResponceFileName = MakeResponceFile(_szFiles, g_LibInfo.node.GetAttribute(wxT("quote-resp"), wxT("1")) == wxT("1")),\r
+               szResponceFileName = g_LibInfo.fRunning ?\r
+                       MakeResponceFile(_szFiles, g_LibInfo.node.GetAttribute(   wxT("quote-resp"), wxT("1")) == wxT("1"), g_LibInfo.fUnicode) :\r
+                       MakeResponceFile(_szFiles, g_LibInfoAlt.node.GetAttribute(wxT("quote-resp"), wxT("1")) == wxT("1"), g_LibInfoAlt.fUnicode),\r
                szCommandLineSend  = MakeCommandLineSend(szCommandLine, _szArcName, _swInfo, _szFiles, szResponceFileName);\r
 \r
        // コマンドライン実行。\r