aboutsummaryrefslogtreecommitdiff
path: root/CPP/Common/MyTypes.h
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/Common/MyTypes.h')
-rw-r--r--CPP/Common/MyTypes.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/CPP/Common/MyTypes.h b/CPP/Common/MyTypes.h
new file mode 100644
index 0000000..71b8e7f
--- /dev/null
+++ b/CPP/Common/MyTypes.h
@@ -0,0 +1,52 @@
1// Common/MyTypes.h
2
3#ifndef __COMMON_MY_TYPES_H
4#define __COMMON_MY_TYPES_H
5
6#include "../../C/7zTypes.h"
7
8typedef int HRes;
9
10struct CBoolPair
11{
12 bool Val;
13 bool Def;
14
15 CBoolPair(): Val(false), Def(false) {}
16
17 void Init()
18 {
19 Val = false;
20 Def = false;
21 }
22
23 void SetTrueTrue()
24 {
25 Val = true;
26 Def = true;
27 }
28
29 void SetVal_as_Defined(bool val)
30 {
31 Val = val;
32 Def = true;
33 }
34};
35
36#define CLASS_NO_COPY(cls) \
37 private: \
38 cls(const cls &); \
39 cls &operator=(const cls &);
40
41class CUncopyable
42{
43protected:
44 CUncopyable() {} // allow constructor
45 // ~CUncopyable() {}
46CLASS_NO_COPY(CUncopyable)
47};
48
49#define MY_UNCOPYABLE :private CUncopyable
50// #define MY_UNCOPYABLE
51
52#endif