disasm/sim: changed interface, branch => br, features++
[calu.git] / 3c_disasm / uint32_from_hex.hpp
diff --git a/3c_disasm/uint32_from_hex.hpp b/3c_disasm/uint32_from_hex.hpp
new file mode 100644 (file)
index 0000000..cea3537
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef __UINT32_FROM_HEX_H__
+#define __UINT32_FROM_HEX_H__
+
+class uint32_from_hex   // For use with boost::lexical_cast
+{
+       typedef unsigned int uint32;
+       uint32 value;
+       public:
+               operator uint32() const {
+                       return value;
+               }
+               friend std::istream& operator>>(std::istream& in, uint32_from_hex& outValue)
+               {
+                       in >> std::hex >> outValue.value;
+                       return in;
+               }
+};
+
+#endif