xref: /aosp_15_r20/external/lzma/CPP/Windows/PropVariantUtils.h (revision f6dc9357d832569d4d1f5d24eacdb3935a1ae8e6)
1*f6dc9357SAndroid Build Coastguard Worker // Windows/PropVariantUtils.h
2*f6dc9357SAndroid Build Coastguard Worker 
3*f6dc9357SAndroid Build Coastguard Worker #ifndef ZIP7_INC_PROP_VARIANT_UTILS_H
4*f6dc9357SAndroid Build Coastguard Worker #define ZIP7_INC_PROP_VARIANT_UTILS_H
5*f6dc9357SAndroid Build Coastguard Worker 
6*f6dc9357SAndroid Build Coastguard Worker #include "../Common/MyString.h"
7*f6dc9357SAndroid Build Coastguard Worker 
8*f6dc9357SAndroid Build Coastguard Worker #include "PropVariant.h"
9*f6dc9357SAndroid Build Coastguard Worker 
10*f6dc9357SAndroid Build Coastguard Worker struct CUInt32PCharPair
11*f6dc9357SAndroid Build Coastguard Worker {
12*f6dc9357SAndroid Build Coastguard Worker   UInt32 Value;
13*f6dc9357SAndroid Build Coastguard Worker   const char *Name;
14*f6dc9357SAndroid Build Coastguard Worker };
15*f6dc9357SAndroid Build Coastguard Worker 
16*f6dc9357SAndroid Build Coastguard Worker AString TypePairToString(const CUInt32PCharPair *pairs, unsigned num, UInt32 value);
17*f6dc9357SAndroid Build Coastguard Worker void PairToProp(const CUInt32PCharPair *pairs, unsigned num, UInt32 value, NWindows::NCOM::CPropVariant &prop);
18*f6dc9357SAndroid Build Coastguard Worker 
19*f6dc9357SAndroid Build Coastguard Worker AString FlagsToString(const char * const *names, unsigned num, UInt32 flags);
20*f6dc9357SAndroid Build Coastguard Worker AString FlagsToString(const CUInt32PCharPair *pairs, unsigned num, UInt32 flags);
21*f6dc9357SAndroid Build Coastguard Worker void FlagsToProp(const char * const *names, unsigned num, UInt32 flags, NWindows::NCOM::CPropVariant &prop);
22*f6dc9357SAndroid Build Coastguard Worker void FlagsToProp(const CUInt32PCharPair *pairs, unsigned num, UInt32 flags, NWindows::NCOM::CPropVariant &prop);
23*f6dc9357SAndroid Build Coastguard Worker 
24*f6dc9357SAndroid Build Coastguard Worker AString TypeToString(const char * const table[], unsigned num, UInt32 value);
25*f6dc9357SAndroid Build Coastguard Worker void TypeToProp(const char * const table[], unsigned num, UInt32 value, NWindows::NCOM::CPropVariant &prop);
26*f6dc9357SAndroid Build Coastguard Worker 
27*f6dc9357SAndroid Build Coastguard Worker #define PAIR_TO_PROP(pairs, value, prop) PairToProp(pairs, Z7_ARRAY_SIZE(pairs), value, prop)
28*f6dc9357SAndroid Build Coastguard Worker #define FLAGS_TO_PROP(pairs, value, prop) FlagsToProp(pairs, Z7_ARRAY_SIZE(pairs), value, prop)
29*f6dc9357SAndroid Build Coastguard Worker #define TYPE_TO_PROP(table, value, prop) TypeToProp(table, Z7_ARRAY_SIZE(table), value, prop)
30*f6dc9357SAndroid Build Coastguard Worker 
31*f6dc9357SAndroid Build Coastguard Worker void Flags64ToProp(const CUInt32PCharPair *pairs, unsigned num, UInt64 flags, NWindows::NCOM::CPropVariant &prop);
32*f6dc9357SAndroid Build Coastguard Worker #define FLAGS64_TO_PROP(pairs, value, prop) Flags64ToProp(pairs, Z7_ARRAY_SIZE(pairs), value, prop)
33*f6dc9357SAndroid Build Coastguard Worker 
34*f6dc9357SAndroid Build Coastguard Worker #endif
35