mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-10 00:07:06 -06:00
9.14
This commit is contained in:
committed by
Kornel Lesiński
parent
3dacb5eb8a
commit
708873490e
@@ -24,6 +24,27 @@ void ConvertUInt32ToHex(UInt32 value, wchar_t *s)
|
||||
s[8] = L'\0';
|
||||
}
|
||||
|
||||
static const char g_WinAttrib[17] = "RHS8DAdNTsrCOnE_";
|
||||
/*
|
||||
0 READONLY
|
||||
1 HIDDEN
|
||||
3 SYSTEM
|
||||
|
||||
4 DIRECTORY
|
||||
5 ARCHIVE
|
||||
6 DEVICE
|
||||
7 NORMAL
|
||||
8 TEMPORARY
|
||||
9 SPARSE_FILE
|
||||
10 REPARSE_POINT
|
||||
11 COMPRESSED
|
||||
12 OFFLINE
|
||||
13 NOT_CONTENT_INDEXED
|
||||
14 ENCRYPTED
|
||||
|
||||
16 VIRTUAL
|
||||
*/
|
||||
|
||||
#define MY_ATTR_CHAR(a, n, c) ((a )& (1 << (n))) ? c : L'-';
|
||||
|
||||
UString ConvertPropertyToString(const PROPVARIANT &prop, PROPID propID, bool full)
|
||||
@@ -55,16 +76,14 @@ UString ConvertPropertyToString(const PROPVARIANT &prop, PROPID propID, bool ful
|
||||
{
|
||||
if (prop.vt != VT_UI4)
|
||||
break;
|
||||
UString res;
|
||||
UInt32 a = prop.ulVal;
|
||||
if (NFile::NFind::NAttributes::IsReadOnly(a)) res += L'R';
|
||||
if (NFile::NFind::NAttributes::IsHidden(a)) res += L'H';
|
||||
if (NFile::NFind::NAttributes::IsSystem(a)) res += L'S';
|
||||
if (NFile::NFind::NAttributes::IsDir(a)) res += L'D';
|
||||
if (NFile::NFind::NAttributes::IsArchived(a)) res += L'A';
|
||||
if (NFile::NFind::NAttributes::IsCompressed(a)) res += L'C';
|
||||
if (NFile::NFind::NAttributes::IsEncrypted(a)) res += L'E';
|
||||
return res;
|
||||
wchar_t sz[32];
|
||||
int pos = 0;
|
||||
for (int i = 0; i < 16; i++)
|
||||
if (a & (1 << i) && i != 7)
|
||||
sz[pos++] = g_WinAttrib[i];
|
||||
sz[pos] = '\0';
|
||||
return sz;
|
||||
}
|
||||
case kpidPosixAttrib:
|
||||
{
|
||||
|
||||
@@ -26,6 +26,7 @@ NUserAnswerMode::EEnum ScanUserYesNoAllQuit(CStdOutStream *outStream)
|
||||
for (;;)
|
||||
{
|
||||
(*outStream) << kHelpQuestionMessage;
|
||||
outStream->Flush();
|
||||
AString scannedString = g_StdIn.ScanStringUntilNewLine();
|
||||
scannedString.Trim();
|
||||
if (!scannedString.IsEmpty())
|
||||
|
||||
@@ -163,40 +163,51 @@ HRESULT CPanel::OpenParentArchiveFolder()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static const wchar_t *kStartExtensions[] =
|
||||
{
|
||||
static const char *kStartExtensions =
|
||||
#ifdef UNDER_CE
|
||||
L"cab",
|
||||
" cab"
|
||||
#endif
|
||||
L"exe", L"bat", L"com",
|
||||
L"chm",
|
||||
L"msi", L"doc", L"xls", L"ppt", L"pps", L"wps", L"wpt", L"wks", L"xlr", L"wdb",
|
||||
" exe bat com"
|
||||
" chm"
|
||||
" msi doc xls ppt pps wps wpt wks xlr wdb"
|
||||
|
||||
L"docx", L"docm", L"dotx", L"dotm", L"xlsx", L"xlsm", L"xltx", L"xltm", L"xlsb",
|
||||
L"xlam", L"pptx", L"pptm", L"potx", L"potm", L"ppam", L"ppsx", L"ppsm", L"xsn",
|
||||
L"msg",
|
||||
L"dwf",
|
||||
" docx docm dotx dotm xlsx xlsm xltx xltm xlsb"
|
||||
" xlam pptx pptm potx potm ppam ppsx ppsm xsn"
|
||||
" mpp"
|
||||
" msg"
|
||||
" dwf"
|
||||
|
||||
L"flv", L"swf",
|
||||
" flv swf"
|
||||
|
||||
L"odt", L"ods",
|
||||
L"wb3",
|
||||
L"pdf"
|
||||
};
|
||||
" odt ods"
|
||||
" wb3"
|
||||
" pdf"
|
||||
" ";
|
||||
|
||||
static bool DoItemAlwaysStart(const UString &name)
|
||||
static bool FindExt(const char *p, const UString &name)
|
||||
{
|
||||
int extPos = name.ReverseFind('.');
|
||||
if (extPos < 0)
|
||||
return false;
|
||||
UString ext = name.Mid(extPos + 1);
|
||||
ext.MakeLower();
|
||||
for (int i = 0; i < sizeof(kStartExtensions) / sizeof(kStartExtensions[0]); i++)
|
||||
if (ext.Compare(kStartExtensions[i]) == 0)
|
||||
AString ext2 = UnicodeStringToMultiByte(ext);
|
||||
for (int i = 0; p[i] != 0;)
|
||||
{
|
||||
int j;
|
||||
for (j = i; p[j] != ' '; j++);
|
||||
if (ext2.Length() == j - i && memcmp(p + i, (const char *)ext2, ext2.Length()) == 0)
|
||||
return true;
|
||||
i = j + 1;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool DoItemAlwaysStart(const UString &name)
|
||||
{
|
||||
return FindExt(kStartExtensions, name);
|
||||
}
|
||||
|
||||
static UString GetQuotedString(const UString &s)
|
||||
{
|
||||
return UString(L'\"') + s + UString(L'\"');
|
||||
|
||||
@@ -229,6 +229,12 @@ static const CFormatInfo g_Formats[] =
|
||||
(1 << 0),
|
||||
0, 0,
|
||||
false, false, false, false, false, false
|
||||
},
|
||||
{
|
||||
L"wim",
|
||||
(1 << 0),
|
||||
0, 0,
|
||||
false, false, false, false, false, false
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1032,7 +1038,7 @@ void CCompressDialog::SetDictionary()
|
||||
if (i == 20 && j > 0)
|
||||
continue;
|
||||
UInt32 dictionary = (1 << i) + (j << (i - 1));
|
||||
if (dictionary >= (1 << 31))
|
||||
if (dictionary > (1 << 30))
|
||||
continue;
|
||||
AddDictionarySize(dictionary);
|
||||
UInt64 decomprSize;
|
||||
|
||||
Reference in New Issue
Block a user