OSDN Git Service

CheckArchiveの簡素化に伴い、キャッシュ機能を削除。
authorsirakaba <sirakaba@9df91469-1e22-0410-86e7-ea8537beb833>
Thu, 23 Sep 2010 04:25:22 +0000 (04:25 +0000)
committersirakaba <sirakaba@9df91469-1e22-0410-86e7-ea8537beb833>
Thu, 23 Sep 2010 04:25:22 +0000 (04:25 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/tpi/tpi@335 9df91469-1e22-0410-86e7-ea8537beb833

src/common/library/library.h
src/plugin/cuiWrapper/cuiWrapper.cpp

index 2279d74..cedc050 100644 (file)
@@ -30,7 +30,7 @@
 //    Functions\r
 //******************************************************************************\r
 \r
-wxString MakeCommandLineSend(wxString szCommandLine, wxString szArcName, TPI_SWITCHES * swInfo, wxArrayString asFiles, wxString szResponceFileName);\r
+wxString MakeCommandLineSend(wxString szCommandLine, wxString szArcName, TPI_SWITCHES * swInfo = NULL, wxArrayString asFiles = wxArrayString(), wxString szResponceFileName = wxEmptyString);\r
 wxString MakeResponceFile(wxArrayString asFiles, bool bQuote, bool bUnicode = false);\r
 wxString MB2String(const char * sz);\r
 wxString UTF82String(const char * sz);\r
index c53f7c2..7bca842 100644 (file)
@@ -46,8 +46,6 @@ struct g_LibInfo
 }      g_LibInfo;\r
 \r
 TPI_PROC g_prProc;\r
-wxString g_szCurrentArchive;\r
-wxArrayString g_asOutput;\r
 \r
 //******************************************************************************\r
 //    Inside Functions\r
@@ -298,7 +296,7 @@ int __stdcall FreePlugin
 int __stdcall CheckArchive\r
 (\r
        const wxString & _szArcName,\r
-       wxULongLong_t * _llFileCount\r
+       wxULongLong_t *\r
 )\r
 {\r
        wxFileName fnArchive(_szArcName);\r
@@ -314,16 +312,7 @@ int __stdcall CheckArchive
 //             if (asExt[i].IsSameAs(fnArchive.GetExt(), false))\r
                if (fnArchive.GetFullName().EndsWith(wxT('.') + asExt[i]))\r
                {\r
-                       // 開いて確認。先行してデータを取得しておく。\r
-                       int nErrorCode = OpenArchive(_szArcName, NULL);\r
-\r
-                       // 対応。\r
-                       if (_llFileCount != NULL)\r
-                       {\r
-                               // ファイル数は多めに取っておく。\r
-                               * _llFileCount = g_asOutput.GetCount();\r
-                       }\r
-                       return nErrorCode;\r
+                       return TPI_ERROR_SUCCESS;\r
                }\r
        }\r
 \r
@@ -336,23 +325,15 @@ int __stdcall OpenArchive
        void * * _hArchive\r
 )\r
 {\r
-       if (g_szCurrentArchive != _szArcName)\r
-       {\r
-               wxString szOutput;\r
-               wxArrayString as;\r
-               if (myExecute(g_LibInfo.szExeFile + wxT(" ") + MakeCommandLineSend(g_LibInfo.node.GetAttribute(wxT("list"), wxEmptyString), _szArcName, NULL, as, wxEmptyString), & szOutput, wxEmptyString) != TPI_ERROR_SUCCESS)\r
-               {\r
-                       return TPI_ERROR_U_USE_LIBRARY;\r
-               }\r
-               g_szCurrentArchive = _szArcName;\r
-               g_asOutput = ::wxStringTokenize(szOutput, wxT("\r\n"));\r
-               g_asOutput.Shrink();\r
-       }\r
-       if (_hArchive != NULL)\r
+       wxString szOutput;\r
+       if (myExecute(g_LibInfo.szExeFile + wxT(" ") + MakeCommandLineSend(g_LibInfo.node.GetAttribute(wxT("list"), wxEmptyString), _szArcName), & szOutput, wxEmptyString) != TPI_ERROR_SUCCESS)\r
        {\r
-               * _hArchive = & g_asOutput;\r
+               return TPI_ERROR_U_USE_LIBRARY;\r
        }\r
-       return g_asOutput.IsEmpty() ? TPI_ERROR_UNDEFINED : TPI_ERROR_SUCCESS;\r
+       wxArrayString * as = new wxArrayString(::wxStringTokenize(szOutput, wxT("\r\n")));\r
+       * _hArchive = (void *) as;\r
+       as->Shrink();\r
+       return as->IsEmpty() ? TPI_ERROR_UNDEFINED : TPI_ERROR_SUCCESS;\r
 }\r
 \r
 int __stdcall CloseArchive\r
@@ -360,7 +341,9 @@ int __stdcall CloseArchive
        void * _hArchive\r
 )\r
 {\r
-       ((wxArrayString *) _hArchive)->Clear();\r
+       wxArrayString * as = (wxArrayString *) _hArchive;\r
+       as->Clear();\r
+       delete as;\r
        return TPI_ERROR_SUCCESS;\r
 }\r
 \r