mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-08 00:06:59 -06:00
15.07
This commit is contained in:
committed by
Kornel Lesiński
parent
cba375916f
commit
f6444c3256
@@ -108,3 +108,42 @@ void FlagsToProp(const CUInt32PCharPair *pairs, unsigned num, UInt32 flags, NCOM
|
||||
{
|
||||
prop = FlagsToString(pairs, num, flags);
|
||||
}
|
||||
|
||||
|
||||
AString Flags64ToString(const CUInt32PCharPair *pairs, unsigned num, UInt64 flags)
|
||||
{
|
||||
AString s;
|
||||
for (unsigned i = 0; i < num; i++)
|
||||
{
|
||||
const CUInt32PCharPair &p = pairs[i];
|
||||
UInt64 flag = (UInt64)1 << (unsigned)p.Value;
|
||||
if ((flags & flag) != 0)
|
||||
{
|
||||
if (p.Name[0] != 0)
|
||||
{
|
||||
if (!s.IsEmpty())
|
||||
s += ' ';
|
||||
s += p.Name;
|
||||
}
|
||||
}
|
||||
flags &= ~flag;
|
||||
}
|
||||
if (flags != 0)
|
||||
{
|
||||
if (!s.IsEmpty())
|
||||
s += ' ';
|
||||
{
|
||||
char sz[32];
|
||||
sz[0] = '0';
|
||||
sz[1] = 'x';
|
||||
ConvertUInt64ToHex(flags, sz + 2);
|
||||
s += sz;
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
void Flags64ToProp(const CUInt32PCharPair *pairs, unsigned num, UInt64 flags, NCOM::CPropVariant &prop)
|
||||
{
|
||||
prop = Flags64ToString(pairs, num, flags);
|
||||
}
|
||||
|
||||
@@ -27,4 +27,7 @@ void TypeToProp(const char * const table[], unsigned num, UInt32 value, NWindows
|
||||
#define FLAGS_TO_PROP(pairs, value, prop) FlagsToProp(pairs, ARRAY_SIZE(pairs), value, prop)
|
||||
#define TYPE_TO_PROP(table, value, prop) TypeToProp(table, ARRAY_SIZE(table), value, prop)
|
||||
|
||||
void Flags64ToProp(const CUInt32PCharPair *pairs, unsigned num, UInt64 flags, NWindows::NCOM::CPropVariant &prop);
|
||||
#define FLAGS64_TO_PROP(pairs, value, prop) Flags64ToProp(pairs, ARRAY_SIZE(pairs), value, prop)
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user