OSDN Git Service

TPI_FORMATINFOに形式名と拡張子をできるだけ格納するよう変更。
authorsirakaba <sirakaba@9df91469-1e22-0410-86e7-ea8537beb833>
Sun, 18 Oct 2009 07:09:38 +0000 (07:09 +0000)
committersirakaba <sirakaba@9df91469-1e22-0410-86e7-ea8537beb833>
Sun, 18 Oct 2009 07:09:38 +0000 (07:09 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/tpi/tpi@62 9df91469-1e22-0410-86e7-ea8537beb833

bin/lib/calLibrary.xml
bin/lib/cuiWrapper.xml
src/common/library/library.cpp
src/common/library/library.h
src/plugin/calLibrary/calLibrary.cpp
src/plugin/cuiWrapper/cuiWrapper.cpp
src/plugin/spiLibrary/spiLibrary.cpp

index fe3a78b..002c224 100644 (file)
@@ -30,7 +30,7 @@
  <library name="7-zip32.dll" prefix="SevenZip" typename="7-Zip" suffix="zip"
         level-min="0" level-max="9"
         add     ='a -tzip -mx=%94 -hide -ssw %a1{-sfx|} %a5{"-p#"|} %a7{-v#|} -- "%90" "%91" "@%92"' />
- <library name="UnIso32.dll" prefix="UnIso"
+ <library name="UnIso32.dll" prefix="UnIso" typename="Iso"
         extract ='%a0{x|e} -hide "-o%91" -- "%90" "@%92"'
         test    ='t -- "%90" "@%92"' />
  <library name="tar32.dll" prefix="Tar" typename="Tar" suffix="tar;gz;bz2;z;tgz"
  <library name="tar32.dll" prefix="Tar" typename="Tar+XZ" suffix="tar.xz"
         level-min="1" level-max="9"
         add     ='-c -J%94 --use-directory=%a0 --display-dialog=0 --inverse-procresult=1 -- "%90" "%91" "@%92"' />
- <library name="unrar32.dll" prefix="Unrar"
+ <library name="unrar32.dll" prefix="Unrar" typename="Rar"
         extract ='-%a0{x|e} -s -r -q %a5{"-p#"|} -- "%90" "%91" "@%92"' />
- <library name="UnGCA32.dll" prefix="UnGCA"
+ <library name="UnGCA32.dll" prefix="UnGCA" typename="Gca"
         extract ='e -sx0 -xx%a0 %a5{-p "#"|} %a6{-k "#"|} "%90" "%91" "@%92"' />
- <library name="UnAceV2J.dll" prefix="UnAce" quote-resp="0"
+ <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" unicode="0"
+ <library name="unarj32j.dll" prefix="Unarj" typename="Arj" unicode="0"
         extract ='%a0{x|e} -i -!@ -- "%90" "%91" "@%92"'
         test    ='t -i -- "%90" "@%92"' />
  <library name="yz1.dll" prefix="Yz1" typename="Yz1" suffix="yz1"
index 3d472cf..afc8fa9 100644 (file)
@@ -43,7 +43,7 @@
         add     ='-%94 -c `cat "%92"` &gt; "%90"'
         extract ='-d -c "%90" &gt; "%91`basename "%90" .gz`"'
         test    ='-t "%90"' />
- <library name="unrar" suffix="rar"
+ <library name="unrar" typename="Rar" suffix="rar"
         list    ='v -c- -- "%90"'
         list-line-s ='-------------------------------------------------------------------------------' list-line-c="2"
         list-fname-s= "1"
@@ -52,7 +52,7 @@
         list-date-s ="37" list-date-c ="14" list-date-l ="1" list-date-f="%d-%m-%y %H:%M"
         extract ='%a0{x|e} %a5{"-p#"|} -- "%90" "@%92" "%91"'
         test    ='t -- "%90" "@%92"' />
- <library name="innounp" suffix="inno"
+ <library name="innounp" typename="Inno" suffix="inno"
         list    ='-v "%90"'
         list-line-s ='--------------------------------------' list-line-c="1"
         list-fname-s="30"
index 69e8f24..4e3f637 100644 (file)
@@ -173,7 +173,12 @@ wxString MakeResponceFile(wxArrayString asFiles, bool bQuote)
 \r
 wxString MB2String(const char * sz)\r
 {\r
-//     wxString szTemp(sz, wxConvLibc);\r
+       wxString szTemp(sz, wxConvLibc);\r
+       return szTemp;\r
+}\r
+\r
+wxString UTF82String(const char * sz)\r
+{\r
        wxString szTemp(sz, wxConvUTF8);\r
        return szTemp;\r
 }\r
index 712795e..59d359e 100644 (file)
@@ -33,6 +33,7 @@
 wxString MakeCommandLineSend(wxString szCommandLine, wxString szArcName, TPI_SWITCHES * swInfo, wxArrayString asFiles, wxString szResponceFileName);\r
 wxString MakeResponceFile(wxArrayString asFiles, bool bQuote);\r
 wxString MB2String(const char * sz);\r
+wxString UTF82String(const char * sz);\r
 wxString WC2String(const wchar_t * sz);\r
 \r
 #ifdef wxUSE_XML\r
index 420e9c5..ba0d7dd 100644 (file)
@@ -141,12 +141,12 @@ BOOL __stdcall CallbackProc(HWND, unsigned int _uMsg, unsigned int _uState, void
                                piInfo.fiInfo.llUnpackedSize    = ex->exinfo.dwFileSize;\r
                                piInfo.fiInfo.uOSType           = ex->uOSType;\r
                                piInfo.fiInfo.wCompressRatio    = ex->wRatio;\r
-                               piInfo.fiInfo.szStoredName      = MB2String(ex->exinfo.szSourceFileName);\r
-                               piInfo.fiInfo.szMethod          = MB2String(ex->szMode);\r
+                               piInfo.fiInfo.szStoredName      = UTF82String(ex->exinfo.szSourceFileName);\r
+                               piInfo.fiInfo.szMethod          = UTF82String(ex->szMode);\r
 \r
                                // EXTRACTINGINFOEX -> TPI_PROCESSINFO\95Ï\8a·\81B\r
                                piInfo.llProcessedSize          = ex->exinfo.dwWriteSize;\r
-                               piInfo.fnDestination            = wxFileName::FileName(MB2String(ex->exinfo.szDestFileName));\r
+                               piInfo.fnDestination            = wxFileName::FileName(UTF82String(ex->exinfo.szDestFileName));\r
                        }\r
                        piInfo.fiInfo.dwAttribute       = 0;\r
                }\r
@@ -189,12 +189,12 @@ BOOL __stdcall CallbackProc(HWND, unsigned int _uMsg, unsigned int _uState, void
                                piInfo.fiInfo.llUnpackedSize    = ex->llFileSize;\r
                                piInfo.fiInfo.uOSType           = ex->uOSType;\r
                                piInfo.fiInfo.wCompressRatio    = ex->wRatio;\r
-                               piInfo.fiInfo.szStoredName      = MB2String(ex->exinfo.szSourceFileName);\r
-                               piInfo.fiInfo.szMethod          = MB2String(ex->szMode);\r
+                               piInfo.fiInfo.szStoredName      = UTF82String(ex->exinfo.szSourceFileName);\r
+                               piInfo.fiInfo.szMethod          = UTF82String(ex->szMode);\r
 \r
                                // EXTRACTINGINFOEX64 -> TPI_PROCESSINFO\95Ï\8a·\81B\r
                                piInfo.llProcessedSize          = ex->llWriteSize;\r
-                               piInfo.fnDestination            = wxFileName::FileName(MB2String(ex->exinfo.szDestFileName));\r
+                               piInfo.fnDestination            = wxFileName::FileName(UTF82String(ex->exinfo.szDestFileName));\r
                        }\r
                }\r
                piInfo.fiInfo.fnFileName        = wxFileName::FileName(piInfo.fiInfo.szStoredName);\r
@@ -640,8 +640,8 @@ int __stdcall GetFileInformation
                        _fiInfo->llPackedSize   = iiInfo.dwCompressedSize;\r
                        _fiInfo->llUnpackedSize = iiInfo.dwOriginalSize;\r
                        _fiInfo->tmModified.SetFromDOS(MAKELONG(iiInfo.wTime, iiInfo.wDate));\r
-                       _fiInfo->szStoredName   = MB2String(iiInfo.szFileName);\r
-                       _fiInfo->szMethod       = MB2String(iiInfo.szMode);\r
+                       _fiInfo->szStoredName   = UTF82String(iiInfo.szFileName);\r
+                       _fiInfo->szMethod       = UTF82String(iiInfo.szMode);\r
                        _fiInfo->wCompressRatio = iiInfo.wRatio;\r
                }\r
                _fiInfo->llFileID       = s_uFileID++;\r
@@ -674,7 +674,7 @@ int __stdcall GetArchiveInformation
                {\r
                        char sz[2049];\r
                        ((int (__stdcall *)(void *, char *, const int)) fpProc)(_hArchive, sz, 2048);\r
-                       s = MB2String(sz);\r
+                       s = UTF82String(sz);\r
                }\r
                _aiInfo->fnArchive = wxFileName::FileName(s);\r
        }\r
@@ -847,7 +847,7 @@ int __stdcall Command
        {\r
                char szTmpOut[2049];\r
                nErrorCode = ((int (__stdcall *)(const HWND, const char *, char *, DWORD)) fpProc)(NULL, g_fExistUnicodeMode ? szCommandLineSend.ToUTF8() : szCommandLineSend.char_str(), szTmpOut, 2048);\r
-               szOutput = MB2String(szTmpOut);\r
+               szOutput = UTF82String(szTmpOut);\r
        }\r
 \r
        // \83\8c\83X\83|\83\93\83X\83t\83@\83C\83\8b\8dí\8f\9c\81B\r
index b962b01..f11a2a8 100644 (file)
@@ -88,7 +88,7 @@ DWORD myExecute(wxString szCommandLine, wxString * szOutput, wxString szCwd, boo
                while (! feof(fp))\r
                {\r
                        fread(sz, sizeof(char), sizeof(sz) - 1, fp);\r
-                       * szOutput += MB2String(sz);\r
+                       * szOutput += UTF82String(sz);\r
                }\r
 //             ::wxMessageBox(* szOutput);\r
        }\r
@@ -139,7 +139,7 @@ DWORD myExecute(wxString szCommandLine, wxString * szOutput, wxString szCwd, boo
                {\r
                        dwSize = 0;\r
                        ::ReadFile(hRead, sz, sizeof(sz) - 1, & dwSize, NULL);\r
-                       * szOutput += MB2String(sz);\r
+                       * szOutput += UTF82String(sz);\r
 //                     ::MessageBoxA(NULL, sz, NULL, 0);\r
                }\r
        }\r
index f83c2ee..90cd098 100644 (file)
@@ -333,8 +333,20 @@ int __stdcall GetArchiveInformation
        TPI_ARCHIVEINFO * _aiInfo\r
 )\r
 {\r
-//     _aiInfo->fiInfo.szTypeName   = ;\r
-//     _aiInfo->fiInfo.szSuffix     = ;\r
+       // GetPluginInfo\82ð\8eÀ\8ds\81B\r
+       FARPROC fpProc = ::GetProcAddress(g_hLib, "GetPluginInfo");\r
+       if (fpProc != NULL)\r
+       {\r
+               char szTemp[20];\r
+               if (((int (PASCAL *)(int, char *, int)) fpProc)(2, szTemp, sizeof(szTemp)) > 0)\r
+               {\r
+                       _aiInfo->fiInfo.szSuffix = MB2String(szTemp);\r
+               }\r
+               if (((int (PASCAL *)(int, char *, int)) fpProc)(3, szTemp, sizeof(szTemp)) > 0)\r
+               {\r
+                       _aiInfo->fiInfo.szTypeName = MB2String(szTemp);\r
+               }\r
+       }\r
        _aiInfo->fiInfo.szTPIName    = wxT("spiLibrary");\r
        _aiInfo->fiInfo.llSupportedCommand = TPI_COMMAND_EXTRACT;\r
 \r