OSDN Git Service

書庫の検査に対応。
authorsirakaba <sirakaba@9df91469-1e22-0410-86e7-ea8537beb833>
Sat, 25 Sep 2010 03:19:57 +0000 (03:19 +0000)
committersirakaba <sirakaba@9df91469-1e22-0410-86e7-ea8537beb833>
Sat, 25 Sep 2010 03:19:57 +0000 (03:19 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/tpi/tpi@355 9df91469-1e22-0410-86e7-ea8537beb833

doc/history.html
src/plugin/eggArc/eggArc.cpp
src/plugin/eggArc/eggArc.h

index a524f54..b3ccc6b 100644 (file)
@@ -75,6 +75,7 @@
      <dt>eggArc</dt>\r
      <dd>\r
       <ul>\r
+       <li class="add">書庫の検査に対応。</li>\r
        <li class="fix">作業ディレクトリからライブラリを読み込まないよう修正。</li>\r
       </ul>\r
      </dd>\r
index 0b72529..ca305da 100644 (file)
@@ -117,7 +117,7 @@ UINT __cdecl CallbackProc(void * user, UINT code, void* param)
                // 対象ファイルか確認。\r
                eggevent::Extract * p = (eggevent::Extract *) param;\r
                GetFileInformation2(* (void **) user, & piInfo.fiInfo, p->index);\r
-               if (g_asFiles->Count() != 0 && g_asFiles->Index(piInfo.fiInfo.fnFileName.GetFullPath()) == wxNOT_FOUND)\r
+               if (g_asFiles->Count() != 0 && g_asFiles->Index(piInfo.fiInfo.szStoredName) == wxNOT_FOUND)\r
                {\r
                        return EGG_ERROR_SKIP;\r
                }\r
@@ -139,6 +139,18 @@ UINT __cdecl CallbackProc(void * user, UINT code, void* param)
                wcsncpy(p->fileName, piInfo.fnDestination.GetFullPath().wchar_str(), MAX_PATH - 1);\r
                return EGG_ERROR_SUCCESS;\r
        }\r
+       case eggevent::Test::CODE:\r
+       {\r
+               // 対象ファイルか確認。\r
+               eggevent::Test * p = (eggevent::Test *) param;\r
+               GetFileInformation2(* (void **) user, & piInfo.fiInfo, p->index);\r
+               if (g_asFiles->Count() != 0 && g_asFiles->Index(piInfo.fiInfo.szStoredName) == wxNOT_FOUND)\r
+               {\r
+                       p->skipThisFile = true;\r
+                       return EGG_ERROR_SKIP;\r
+               }\r
+               return EGG_ERROR_SUCCESS;\r
+       }\r
        case eggevent::ActivityStart::CODE:\r
                piInfo.eStatus = TPI_STATUS_BEGINPROCESS;\r
                GetFileInformation2(* (void **) user, & piInfo.fiInfo, ((eggevent::ActivityStart *) param)->index);\r
@@ -239,7 +251,7 @@ int __stdcall GetFormatInformation(TPI_FORMATINFO * _fiInfo, bool _bFirst)
        _fiInfo->szEngineName = wxT("UnEGG32.dll");\r
        _fiInfo->szTPIName    = wxT("eggArc");\r
        _fiInfo->nTypeId      = 0;\r
-       _fiInfo->eSupportedCommand = TPI_COMMAND_EXTRACT;\r
+       _fiInfo->eSupportedCommand = TPI_COMMAND_EXTRACT | TPI_COMMAND_TEST;\r
        _fiInfo->fArchive     = true;\r
        _fiInfo->fComment     = true;\r
        _fiInfo->fSFX         = true;\r
@@ -405,7 +417,7 @@ int __stdcall Command
        const wxArrayString & _szFiles\r
 )\r
 {\r
-       if (_eCommand != TPI_COMMAND_EXTRACT)\r
+       if (_eCommand != TPI_COMMAND_EXTRACT && _eCommand != TPI_COMMAND_TEST)\r
        {\r
                return TPI_ERROR_U_USE_LIBRARY;\r
        }\r
@@ -422,7 +434,7 @@ int __stdcall Command
        g_swInfo = _swInfo;\r
        g_asFiles = & _szFiles;\r
 \r
-       FARPROC fpProc = ::GetAPIAddress("Extract");\r
+       FARPROC fpProc = _eCommand == TPI_COMMAND_EXTRACT ? ::GetAPIAddress("Extract") : ::GetAPIAddress("Test");\r
        if (fpProc == NULL)\r
        {\r
                return TPI_ERROR_U_USE_LIBRARY;\r
index 1f3a8a6..3e97dc1 100644 (file)
 *******************************************************************************/\r
 \r
 //******************************************************************************\r
-//    Defines\r
+//     Defines\r
 //******************************************************************************\r
 \r
 // Type Code\r
 typedef int egg_type;\r
 const egg_type EGG_TYPE_INVALID = 0;\r
-const egg_type EGG_TYPE_ALZ     = 1;\r
-const egg_type EGG_TYPE_EGG     = 2;\r
+const egg_type EGG_TYPE_ALZ        = 1;\r
+const egg_type EGG_TYPE_EGG        = 2;\r
 \r
 // Error Code\r
-const UINT EGG_ERROR_FAIL       = 0;\r
-const UINT EGG_ERROR_SUCCESS    = 1;\r
-const UINT EGG_ERROR_SKIP       = 2;\r
-const UINT EGG_ERROR_CANCEL     = 3;\r
-const UINT EGG_ERROR_IO         = 4;\r
-const UINT EGG_ERROR_TYPEMISMATCH=5;\r
-const UINT EGG_ERROR_FILE       = 6;\r
-const UINT EGG_ERROR_FORMAT     = 7;\r
-const UINT EGG_ERROR_ALGORITHM  = 8;\r
+const UINT EGG_ERROR_FAIL           = 0;\r
+const UINT EGG_ERROR_SUCCESS        = 1;\r
+const UINT EGG_ERROR_SKIP           = 2;\r
+const UINT EGG_ERROR_CANCEL         = 3;\r
+const UINT EGG_ERROR_IO                        = 4;\r
+const UINT EGG_ERROR_TYPEMISMATCH   = 5;\r
+const UINT EGG_ERROR_FILE           = 6;\r
+const UINT EGG_ERROR_FORMAT            = 7;\r
+const UINT EGG_ERROR_ALGORITHM      = 8;\r
+const UINT EGG_ERROR_WRONGPASSWORD  = 9;\r
 \r
 // Work Code\r
 const UINT EGG_WORKCODE_NONE    = 0;\r
 const UINT EGG_WORKCODE_SCAN    = 1;\r
 const UINT EGG_WORKCODE_EXTRACT = 2;\r
+const UINT EGG_WORKCODE_TEST    = 3;\r
 \r
 //******************************************************************************\r
-//    Structures\r
+//     Structures\r
 //******************************************************************************\r
 \r
 typedef size_t egg_handle;\r
 \r
 struct EGGFileHeader\r
 {\r
-    size_t size;\r
-    LPCTSTR fileName;\r
-    LPCTSTR comment;\r
-    unsigned __int64 packedSize;\r
-    unsigned __int64 unpackedSize;\r
-    unsigned int attribute;\r
-    unsigned int crc;\r
-    unsigned int method;\r
-    time_t lastModified;\r
-    BOOL encrypted;\r
+       size_t size;\r
+       LPCTSTR fileName;\r
+       LPCTSTR comment;\r
+       unsigned __int64 packedSize;\r
+       unsigned __int64 unpackedSize;\r
+       unsigned int attribute;\r
+       unsigned int crc;\r
+       unsigned int method;\r
+       time_t lastModified;\r
+       BOOL encrypted;\r
 };\r
 \r
 namespace eggevent\r
 {\r
-    struct Extract\r
-    {\r
-        static const UINT CODE = 1;\r
-\r
-        size_t index;\r
-        LPCTSTR nameInArchive;\r
-        TCHAR fileName[MAX_PATH];\r
-    };\r
-\r
-    struct Progress\r
-    {\r
-        static const UINT CODE = 2;\r
-        short total;\r
-        short current;\r
-    };\r
-\r
-    struct Start\r
-    {\r
-        static const UINT CODE = 3;\r
-        UINT code;\r
-    };\r
-    \r
-    struct Finish\r
-    {\r
-        static const UINT CODE = 4;\r
-        UINT code;\r
-        UINT result;\r
-    };\r
-\r
-    struct ActivityStart\r
-    {\r
-        static const UINT CODE = 5;\r
-        size_t index;\r
-        UINT code;\r
-    };\r
-\r
-    struct ActivityFinish\r
-    {\r
-        static const UINT CODE = 6;\r
-        size_t index;\r
-        UINT code;\r
-        UINT result;\r
-    };\r
-\r
-    struct QueryPassword\r
-    {\r
-        static const UINT CODE = 7;\r
-        size_t index;\r
-        size_t queryCount;\r
-        TCHAR password[1024];\r
-    };\r
-\r
-    struct Error\r
-    {\r
-        static const UINT CODE = 8;\r
-        UINT code;\r
-    };\r
-\r
-    typedef UINT (__cdecl *Proc)(void* user, UINT code, void* param);\r
+       struct Extract\r
+       {\r
+               static const UINT CODE = 1;\r
+\r
+               size_t index;\r
+               LPCTSTR nameInArchive;\r
+               TCHAR fileName[MAX_PATH];\r
+       };\r
+\r
+       struct Progress\r
+       {\r
+               static const UINT CODE = 2;\r
+               short total;\r
+               short current;\r
+       };\r
+\r
+       struct Start\r
+       {\r
+               static const UINT CODE = 3;\r
+               UINT code;\r
+       };\r
+       \r
+       struct Finish\r
+       {\r
+               static const UINT CODE = 4;\r
+               UINT code;\r
+               UINT result;\r
+       };\r
+\r
+       struct ActivityStart\r
+       {\r
+               static const UINT CODE = 5;\r
+               size_t index;\r
+               UINT code;\r
+       };\r
+\r
+       struct ActivityFinish\r
+       {\r
+               static const UINT CODE = 6;\r
+               size_t index;\r
+               UINT code;\r
+               UINT result;\r
+       };\r
+\r
+       struct QueryPassword\r
+       {\r
+               static const UINT CODE = 7;\r
+               size_t index;\r
+               size_t queryCount;\r
+               TCHAR password[1024];\r
+       };\r
+\r
+       struct Error\r
+       {\r
+               static const UINT CODE = 8;\r
+               UINT code;\r
+       };\r
+\r
+       struct Test\r
+       {\r
+               static const UINT CODE = 9;\r
+               size_t index;\r
+               LPCTSTR nameInArchive;\r
+               BOOL skipThisFile;\r
+       };\r
+\r
+       typedef UINT (__cdecl *Proc)(void* user, UINT code, void* param);\r
 };\r