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();
|
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)
|
bool aga_unzip(const char* zipfile, const char* destdir)
|
||||||
{
|
{
|
||||||
wxArrayString aFiles;
|
wxArrayString aFiles;
|
||||||
@ -114,14 +136,13 @@ bool aga_unzip(const char* zipfile, const char* destdir)
|
|||||||
wxZipInputStream fin(zipfile, strFileName);
|
wxZipInputStream fin(zipfile, strFileName);
|
||||||
|
|
||||||
wxString strOutFile = destdir;
|
wxString strOutFile = destdir;
|
||||||
if (!wxEndsWithPathSeparator(strOutFile))
|
if (!wxEndsWithPathSeparator(strOutFile) && !wxIsPathSeparator(strFileName[0]))
|
||||||
strOutFile += wxFILE_SEP_PATH;
|
strOutFile += wxFILE_SEP_PATH;
|
||||||
strOutFile += strFileName;
|
strOutFile += strFileName;
|
||||||
|
|
||||||
wxString strPath;
|
wxString strPath;
|
||||||
::wxSplitPath(strOutFile, &strPath, NULL, NULL);
|
::wxSplitPath(strOutFile, &strPath, NULL, NULL);
|
||||||
if (!::wxDirExists(strPath))
|
aga_create_dir(strPath);
|
||||||
::wxMkdir(strPath);
|
|
||||||
|
|
||||||
wxFileOutputStream fout(strOutFile);
|
wxFileOutputStream fout(strOutFile);
|
||||||
fout.Write(fin);
|
fout.Write(fin);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user