summaryrefslogtreecommitdiffstats
path: root/src/libs/7zip/unix/CPP/Windows/PropVariantUtils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/7zip/unix/CPP/Windows/PropVariantUtils.h')
-rw-r--r--src/libs/7zip/unix/CPP/Windows/PropVariantUtils.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/libs/7zip/unix/CPP/Windows/PropVariantUtils.h b/src/libs/7zip/unix/CPP/Windows/PropVariantUtils.h
new file mode 100644
index 000000000..5aaf65cb9
--- /dev/null
+++ b/src/libs/7zip/unix/CPP/Windows/PropVariantUtils.h
@@ -0,0 +1,28 @@
+// Windows/PropVariantUtils.h
+
+#ifndef __PROP_VARIANT_UTILS_H
+#define __PROP_VARIANT_UTILS_H
+
+#include "Common/MyString.h"
+#include "PropVariant.h"
+
+struct CUInt32PCharPair
+{
+ UInt32 Value;
+ const char *Name;
+};
+
+void StringToProp(const AString &s, NWindows::NCOM::CPropVariant &prop);
+void PairToProp(const CUInt32PCharPair *pairs, unsigned num, UInt32 value, NWindows::NCOM::CPropVariant &prop);
+
+AString FlagsToString(const CUInt32PCharPair *pairs, unsigned num, UInt32 flags);
+void FlagsToProp(const CUInt32PCharPair *pairs, unsigned num, UInt32 flags, NWindows::NCOM::CPropVariant &prop);
+
+AString TypeToString(const char *table[], unsigned num, UInt32 value);
+void TypeToProp(const char *table[], unsigned num, UInt32 value, NWindows::NCOM::CPropVariant &prop);
+
+#define PAIR_TO_PROP(pairs, value, prop) PairToProp(pairs, sizeof(pairs) / sizeof(pairs[0]), value, prop)
+#define FLAGS_TO_PROP(pairs, value, prop) FlagsToProp(pairs, sizeof(pairs) / sizeof(pairs[0]), value, prop)
+#define TYPE_TO_PROP(table, value, prop) TypeToProp(table, sizeof(table) / sizeof(table[0]), value, prop)
+
+#endif