Patch level :2.0 partners 672
Files correlati :xvagadll.dll Ricompilazione Demo : [ ] Commento : AO20131 Ripristinando su un'area dati vuota una ditta comprendente anche la cartella CUSTOM con le personalizzazioni, tale cartella non viene ripristinata; tant'è vero che uscendo dal backup viene restituito un messaggio di errore su BA2 riguardante il percorso di queste personalizzazioni. git-svn-id: svn://10.65.10.50/trunk@11719 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
dffac44daa
commit
b2e114ae8d
@ -93,6 +93,28 @@ unsigned int aga_ziplist(const char* zipfile, wxArrayString& aFiles)
|
||||
return aFiles.GetCount();
|
||||
}
|
||||
|
||||
int aga_find_slash(const wxString& path, int from)
|
||||
{
|
||||
for (int i = from; path[i]; i++)
|
||||
if (wxIsPathSeparator(path[i]))
|
||||
return i;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
void aga_create_dir(wxString strPath)
|
||||
{
|
||||
if (!wxEndsWithPathSeparator(strPath))
|
||||
strPath += wxFILE_SEP_PATH;
|
||||
|
||||
for (int i = aga_find_slash(strPath, 0); i > 0; i = aga_find_slash(strPath, i+1))
|
||||
{
|
||||
const wxString strDir = strPath.Mid(0,i);
|
||||
if (!::wxDirExists(strDir))
|
||||
::wxMkdir(strDir);
|
||||
}
|
||||
}
|
||||
|
||||
bool aga_unzip(const char* zipfile, const char* destdir)
|
||||
{
|
||||
wxArrayString aFiles;
|
||||
@ -114,15 +136,14 @@ bool aga_unzip(const char* zipfile, const char* destdir)
|
||||
wxZipInputStream fin(zipfile, strFileName);
|
||||
|
||||
wxString strOutFile = destdir;
|
||||
if (!wxEndsWithPathSeparator(strOutFile))
|
||||
if (!wxEndsWithPathSeparator(strOutFile) && !wxIsPathSeparator(strFileName[0]))
|
||||
strOutFile += wxFILE_SEP_PATH;
|
||||
strOutFile += strFileName;
|
||||
|
||||
wxString strPath;
|
||||
::wxSplitPath(strOutFile, &strPath, NULL, NULL);
|
||||
if (!::wxDirExists(strPath))
|
||||
::wxMkdir(strPath);
|
||||
|
||||
aga_create_dir(strPath);
|
||||
|
||||
wxFileOutputStream fout(strOutFile);
|
||||
fout.Write(fin);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user