Update to 7-Zip 17.00 Beta

This commit is contained in:
Tino Reichardt
2017-04-30 14:14:14 +02:00
parent 54389d6e2f
commit aa5ba75da0
451 changed files with 15746 additions and 8574 deletions

View File

@@ -9,21 +9,24 @@
#define UINT_TO_STR_2(c, val) { s[0] = (c); s[1] = (char)('0' + (val) / 10); s[2] = (char)('0' + (val) % 10); s += 3; }
bool ConvertFileTimeToString(const FILETIME &ft, char *s, bool includeTime, bool includeSeconds) throw()
bool ConvertUtcFileTimeToString(const FILETIME &utc, char *s, int level) throw()
{
*s = 0;
FILETIME ft;
if (!FileTimeToLocalFileTime(&utc, &ft))
return false;
SYSTEMTIME st;
if (!BOOLToBool(FileTimeToSystemTime(&ft, &st)))
{
*s = 0;
return false;
}
unsigned val = st.wYear;
if (val >= 10000)
{
*s++ = (char)('0' + val / 10000);
val %= 10000;
}
{
unsigned val = st.wYear;
if (val >= 10000)
{
*s++ = (char)('0' + val / 10000);
val %= 10000;
}
s[3] = (char)('0' + val % 10); val /= 10;
s[2] = (char)('0' + val % 10); val /= 10;
s[1] = (char)('0' + val % 10);
@@ -32,40 +35,66 @@ bool ConvertFileTimeToString(const FILETIME &ft, char *s, bool includeTime, bool
}
UINT_TO_STR_2('-', st.wMonth);
UINT_TO_STR_2('-', st.wDay);
if (includeTime)
if (level > kTimestampPrintLevel_DAY)
{
UINT_TO_STR_2(' ', st.wHour);
UINT_TO_STR_2(':', st.wMinute);
if (includeSeconds)
if (level >= kTimestampPrintLevel_SEC)
{
UINT_TO_STR_2(':', st.wSecond);
/*
*s++ = '.';
unsigned val = st.wMilliseconds;
s[2] = (char)('0' + val % 10); val /= 10;
s[1] = (char)('0' + val % 10);
s[0] = (char)('0' + val / 10);
s += 3;
*/
if (level > kTimestampPrintLevel_SEC)
{
*s++ = '.';
/*
{
unsigned val = st.wMilliseconds;
s[2] = (char)('0' + val % 10); val /= 10;
s[1] = (char)('0' + val % 10);
s[0] = (char)('0' + val / 10);
s += 3;
}
*s++ = ' ';
*/
{
unsigned numDigits = 7;
UInt32 val = (UInt32)((((UInt64)ft.dwHighDateTime << 32) + ft.dwLowDateTime) % 10000000);
for (unsigned i = numDigits; i != 0;)
{
i--;
s[i] = (char)('0' + val % 10); val /= 10;
}
if (numDigits > (unsigned)level)
numDigits = (unsigned)level;
s += numDigits;
}
}
}
}
*s = 0;
return true;
}
void ConvertFileTimeToString(const FILETIME &ft, wchar_t *dest, bool includeTime, bool includeSeconds) throw()
bool ConvertUtcFileTimeToString(const FILETIME &ft, wchar_t *dest, int level) throw()
{
char s[32];
ConvertFileTimeToString(ft, s, includeTime, includeSeconds);
bool res = ConvertUtcFileTimeToString(ft, s, level);
for (unsigned i = 0;; i++)
{
unsigned char c = s[i];
dest[i] = c;
if (c == 0)
return;
break;
}
return res;
}
void ConvertPropVariantToShortString(const PROPVARIANT &prop, char *dest) throw()
{
*dest = 0;
@@ -77,7 +106,7 @@ void ConvertPropVariantToShortString(const PROPVARIANT &prop, char *dest) throw(
case VT_UI2: ConvertUInt32ToString(prop.uiVal, dest); return;
case VT_UI4: ConvertUInt32ToString(prop.ulVal, dest); return;
case VT_UI8: ConvertUInt64ToString(prop.uhVal.QuadPart, dest); return;
case VT_FILETIME: ConvertFileTimeToString(prop.filetime, dest, true, true); return;
case VT_FILETIME: ConvertUtcFileTimeToString(prop.filetime, dest); return;
// case VT_I1: return ConvertInt64ToString(prop.cVal, dest); return;
case VT_I2: ConvertInt64ToString(prop.iVal, dest); return;
case VT_I4: ConvertInt64ToString(prop.lVal, dest); return;
@@ -98,7 +127,7 @@ void ConvertPropVariantToShortString(const PROPVARIANT &prop, wchar_t *dest) thr
case VT_UI2: ConvertUInt32ToString(prop.uiVal, dest); return;
case VT_UI4: ConvertUInt32ToString(prop.ulVal, dest); return;
case VT_UI8: ConvertUInt64ToString(prop.uhVal.QuadPart, dest); return;
case VT_FILETIME: ConvertFileTimeToString(prop.filetime, dest, true, true); return;
case VT_FILETIME: ConvertUtcFileTimeToString(prop.filetime, dest); return;
// case VT_I1: return ConvertInt64ToString(prop.cVal, dest); return;
case VT_I2: ConvertInt64ToString(prop.iVal, dest); return;
case VT_I4: ConvertInt64ToString(prop.lVal, dest); return;