X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPackets%2FDumpFormat.cc;h=3c41abaea916c61f53f4d52b5c14c698720ee642;hb=78a6e233083efa63a9cd0684a92abc64202a9ee7;hp=2c99df20c46a8228b4c3f6d69f7b94bf8186b5da;hpb=f076d352ab8df15662180942996ebc70a9e4d765;p=senf.git diff --git a/senf/Packets/DumpFormat.cc b/senf/Packets/DumpFormat.cc index 2c99df2..3c41aba 100644 --- a/senf/Packets/DumpFormat.cc +++ b/senf/Packets/DumpFormat.cc @@ -1,6 +1,6 @@ // $Id$ // -// Copyright (C) 2009 +// Copyright (C) 2009 // Fraunhofer Institute for Open Communication Systems (FOKUS) // Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund @@ -24,7 +24,7 @@ \brief DumpFormat non-inline non-template implementation */ #include "Packets.hh" -#include "DumpFormat.ih" +//#include "DumpFormat.ih" // Custom includes #include @@ -46,36 +46,6 @@ prefix_ std::string senf::fieldName(std::string const & s) return t; } -prefix_ std::string senf::detail::prettySignedNumber(long long v, unsigned bits) -{ - if (v<0) return prettyUnsignedNumber(-v,bits,-1); - else return prettyUnsignedNumber(v,bits,+1); -} - -prefix_ std::string senf::detail::prettyUnsignedNumber(unsigned long long v, unsigned bits, - int sign) -{ - int bytes ((bits+7)/8); - int digs (int(2.4*bytes)+1); - std::stringstream ss; - ss << (sign ? (sign<0 ? "-" : " ") : "") - << "0x" << std::setw(2*bytes) << std::setfill('0') << std::hex - << 1u*v - << " (" << std::setw(digs+(sign ? 1 : 0)) << std::setfill(' ') << std::dec; - if (sign) - ss << sign*static_cast(v); - else - ss << 1u*v; - ss << ") ("; - for (int i (bytes-1); i>=0; --i) { - char c ((v>>(8*i))&0xff); - ss << ((c>=32 && c<=127) ? c : '.'); - } - ss << ')'; - return ss.str(); -} - - ///////////////////////////////cc.e//////////////////////////////////////// #undef prefix_ //#include "DumpFormat.mpp"