Index: /trunk/FACT++/src/Converter.cc
===================================================================
--- /trunk/FACT++/src/Converter.cc	(revision 10424)
+++ /trunk/FACT++/src/Converter.cc	(revision 10425)
@@ -211,4 +211,22 @@
 T Converter::Get(std::stringstream &line) const
 {
+    char c;
+    line >> c;
+
+    if (c=='0')
+    {
+        if (line.peek()==-1)
+            return 0;
+
+        if (line.peek()=='x')
+            line >> hex;
+        else
+            line >> oct;
+
+        line.unget();
+    }
+
+    line.unget();
+
     T val;
     line >> val;
@@ -331,39 +349,4 @@
     return stream.str();
 }
-
-// --------------------------------------------------------------------------
-//
-//! Converts from a binary block into a hex representation.
-//!
-//! @param dat
-//!     Pointer to the data block
-//!
-//! @param size
-//!     Size of the data block
-//!
-//! @param chunk
-//!     Size of the size of hex chunks seperted by a ':' in bytes
-//!
-//! @returns
-//!     The string
-//!
-string Converter::GetHex(const void *dat, size_t size, size_t chunk)
-{
-    const unsigned char *ptr = reinterpret_cast<const unsigned char *>(dat);
-
-    ostringstream text;
-
-    text << hex;
-
-    for (size_t i=0; i<size; i++)
-    {
-        text << setw(2) << setfill('0') << (unsigned int)ptr[i];
-        if ((i%chunk)==chunk-1)
-            text << ":";
-    }
-
-    return text.str();
-}
-
 
 // --------------------------------------------------------------------------
Index: /trunk/FACT++/src/Converter.h
===================================================================
--- /trunk/FACT++/src/Converter.h	(revision 10424)
+++ /trunk/FACT++/src/Converter.h	(revision 10425)
@@ -2,8 +2,13 @@
 #define FACT_Converter
 
+#include <math.h>
+
 #include <vector>
-#include <ostream>
+#include <iomanip>
+#include <sstream>
 
 #include <boost/any.hpp>
+
+#include <stdexcept>
 
 class Converter
@@ -89,26 +94,35 @@
     std::vector<char>       GetVector(const std::string &str) const;
 
-    static std::string GetHex(const void *d, size_t size, size_t chunk=1);
-    
     void ToFits(void* dest, const void* src, size_t size) const;
-    
+
     std::vector<char> ToFits(const void* src, size_t size) const; 
 
-/*
-    // Returns the number of entries in Converter:vec
-    int N() const { return vec.size(); }
+    template<typename T>
+        static std::string GetHex(const void *dat, size_t size, size_t col=0, bool prefix=true)
+    {
+        if (size%sizeof(T)!=0)
+            throw std::runtime_error("Total not dividable by typesize.");
 
-    /// Checks if an entry with the given class type is available at index i in Converter::vec
-    template <class T>
-        bool Has(unsigned int i) const { return i<vec.size() && vec[i].type()==typeid(T); }
+        const T *ptr = reinterpret_cast<const T*>(dat);
 
-    /// return the entry with the given class type at index i from Converter::vec (exception safe)
-    template <class T>
-        T Get(int i) const { return !Has<T>(i) ? T() : boost::any_cast<T>(vec[i]); }
+        std::ostringstream text;
+        text << std::hex;
 
-    /// return the entry with the given class type at index i from Converter::vec (throws exceptions)
-    template <class T>
-        T At(int i) const { return boost::any_cast<T>(vec[i]); }
-*/
+        const size_t w = log2l(size+1)/4+1;
+
+        for (size_t i=0; i<size/sizeof(T); i++)
+        {
+            if (prefix && i%col==0)
+                text << std::setfill('0') << std::setw(w) << i << "| ";
+
+            text << std::setfill('0') << std::setw(2*sizeof(T)) << (unsigned int)ptr[i];
+            text << ':';
+
+            if (i%col==col-1)
+                text << '\n';
+        }
+
+        return text.str();
+    }
 
     static std::vector<std::string> Regex(const std::string &expr, const std::string &line);
@@ -116,2 +130,27 @@
 
 #endif
+
+// ***************************************************************************
+/** @fn GetHex(const void *dat, size_t size)
+
+Converts from a binary block into a hex representation.
+
+@param dat
+    Pointer to the data block
+
+@param size
+    Size of the data block (in bytes)
+
+@param col
+    Number of columns before new line
+
+@tparam T
+    type to which the data should be converted. Most usefull types are
+    unsigned byte, unsigned short, unsigned int, uint8_t, uint16_t, ...
+
+@returns
+    The string
+
+
+**/
+// ***************************************************************************
