From c9cbeced5b3f2bdd7407e29c0811e65954132540 Mon Sep 17 00:00:00 2001 From: Root THC Date: Tue, 24 Feb 2026 12:42:47 +0000 Subject: initial --- other/Kermit/lib/SystemMap.cpp | 67 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 other/Kermit/lib/SystemMap.cpp (limited to 'other/Kermit/lib/SystemMap.cpp') diff --git a/other/Kermit/lib/SystemMap.cpp b/other/Kermit/lib/SystemMap.cpp new file mode 100644 index 0000000..03e2fb4 --- /dev/null +++ b/other/Kermit/lib/SystemMap.cpp @@ -0,0 +1,67 @@ +/* + * SystemMap.cpp: + * written by palmers / teso + */ +#include + + + SystemMap::SystemMap (string a) + { + string tmp; + unsigned int num = 0; + ifstream f; + + f.open (a.c_str ()); + if (!f.is_open ()) + { + cerr << "Error opening file \"" << a << "\"!" << endl; + abort (); + } + + f.setf (ios::skipws); + f.setf (ios::hex, ios::basefield); + + while (!f.eof ()) + { + f >> num; + f >> tmp; + f >> tmp; + + add_map.insert (add_map.end (), bla_val (tmp, num)); + } + f.close (); + } + + + SystemMap::SystemMap () + { + } + + + SystemMap::~SystemMap () + { + add_map.clear (); + } + + + bool SystemMap::contains (string a) + { + if (add_map.find (a) == add_map.end ()) + return false; + return true; + } + + + void SystemMap::add (string a, unsigned int x) + { + add_map.insert (add_map.end (), bla_val (a, x)); + } + + + unsigned int SystemMap::operator[] (string a) + { + if (add_map.find (a) == add_map.end ()) + return 0; + return add_map[a]; + } + -- cgit v1.3