aboutsummaryrefslogtreecommitdiff
path: root/CPP/Windows/PropVariantUtils.h
diff options
context:
space:
mode:
authorIgor Pavlov <87184205+ip7z@users.noreply.github.com>2021-12-27 00:00:00 +0000
committerIgor Pavlov <87184205+ip7z@users.noreply.github.com>2022-03-18 15:35:13 +0500
commitf19f813537c7aea1c20749c914e756b54a9c3cf5 (patch)
tree816ba62ca7c0fa19f2eb46d9e9d6f7dd7c3a744d /CPP/Windows/PropVariantUtils.h
parent98e06a519b63b81986abe76d28887f6984a7732b (diff)
download7zip-21.07.tar.gz
7zip-21.07.tar.bz2
7zip-21.07.zip
'21.07'21.07
Diffstat (limited to 'CPP/Windows/PropVariantUtils.h')
-rw-r--r--CPP/Windows/PropVariantUtils.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/CPP/Windows/PropVariantUtils.h b/CPP/Windows/PropVariantUtils.h
new file mode 100644
index 0000000..3dd8295
--- /dev/null
+++ b/CPP/Windows/PropVariantUtils.h
@@ -0,0 +1,34 @@
1// Windows/PropVariantUtils.h
2
3#ifndef __PROP_VARIANT_UTILS_H
4#define __PROP_VARIANT_UTILS_H
5
6#include "../Common/MyString.h"
7
8#include "PropVariant.h"
9
10struct CUInt32PCharPair
11{
12 UInt32 Value;
13 const char *Name;
14};
15
16AString TypePairToString(const CUInt32PCharPair *pairs, unsigned num, UInt32 value);
17void PairToProp(const CUInt32PCharPair *pairs, unsigned num, UInt32 value, NWindows::NCOM::CPropVariant &prop);
18
19AString FlagsToString(const char * const *names, unsigned num, UInt32 flags);
20AString FlagsToString(const CUInt32PCharPair *pairs, unsigned num, UInt32 flags);
21void FlagsToProp(const char * const *names, unsigned num, UInt32 flags, NWindows::NCOM::CPropVariant &prop);
22void FlagsToProp(const CUInt32PCharPair *pairs, unsigned num, UInt32 flags, NWindows::NCOM::CPropVariant &prop);
23
24AString TypeToString(const char * const table[], unsigned num, UInt32 value);
25void TypeToProp(const char * const table[], unsigned num, UInt32 value, NWindows::NCOM::CPropVariant &prop);
26
27#define PAIR_TO_PROP(pairs, value, prop) PairToProp(pairs, ARRAY_SIZE(pairs), value, prop)
28#define FLAGS_TO_PROP(pairs, value, prop) FlagsToProp(pairs, ARRAY_SIZE(pairs), value, prop)
29#define TYPE_TO_PROP(table, value, prop) TypeToProp(table, ARRAY_SIZE(table), value, prop)
30
31void Flags64ToProp(const CUInt32PCharPair *pairs, unsigned num, UInt64 flags, NWindows::NCOM::CPropVariant &prop);
32#define FLAGS64_TO_PROP(pairs, value, prop) Flags64ToProp(pairs, ARRAY_SIZE(pairs), value, prop)
33
34#endif