Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/Common/MyMap.h')
-rwxr-xr-xCPP/Common/MyMap.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/CPP/Common/MyMap.h b/CPP/Common/MyMap.h
new file mode 100755
index 00000000..d0dd43f5
--- /dev/null
+++ b/CPP/Common/MyMap.h
@@ -0,0 +1,28 @@
+// MyMap.h
+
+#ifndef __COMMON_MYMAP_H
+#define __COMMON_MYMAP_H
+
+#include "MyVector.h"
+#include "Types.h"
+
+class CMap32
+{
+ struct CNode
+ {
+ UInt32 Key;
+ UInt32 Keys[2];
+ UInt32 Values[2];
+ UInt16 Len;
+ Byte IsLeaf[2];
+ };
+ CRecordVector<CNode> Nodes;
+
+public:
+
+ void Clear() { Nodes.Clear(); }
+ bool Find(UInt32 key, UInt32 &valueRes) const;
+ bool Set(UInt32 key, UInt32 value); // returns true, if there is such key already
+};
+
+#endif