X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FParseInt.hh;h=3f35b933c36591a9dc909ac7d368a28acb045fd2;hb=5d62f84a80b2c72cc0aa5cabc3ddad752e87fcc8;hp=ba13aafcc47deaa51f38a22978bd0d67043a4f46;hpb=33157146abaca548e145c577a0840cd1bd427789;p=senf.git diff --git a/Packets/ParseInt.hh b/Packets/ParseInt.hh index ba13aaf..3f35b93 100644 --- a/Packets/ParseInt.hh +++ b/Packets/ParseInt.hh @@ -24,6 +24,7 @@ #define HH_ParseInt_ 1 // Custom includes +#include #include "ParserBase.hh" #include #include @@ -58,6 +59,9 @@ namespace senf { void value(value_type v) { this->i()[0] = v; } Parse_Int8 const & operator= (value_type other) { value(other); return *this; } }; + template + std::ostream & operator<<(std::ostream & os, Parse_Int8 const & i) + { os << i.value(); return os; } template struct Parse_UInt8 @@ -81,6 +85,9 @@ namespace senf { void value(value_type v) { this->i()[0] = v; } Parse_UInt8 const & operator= (value_type other) { value(other); return *this; } }; + template + std::ostream & operator<<(std::ostream & os, Parse_UInt8 const & i) + { os << i.value(); return os; } template struct Parse_Int16 @@ -104,6 +111,9 @@ namespace senf { void value(value_type v) { impl::write_uint16(this->i(),v); } Parse_Int16 const & operator= (value_type other) { value(other); return *this; } }; + template + std::ostream & operator<<(std::ostream & os, Parse_Int16 const & i) + { os << i.value(); return os; } template struct Parse_UInt16 @@ -127,6 +137,9 @@ namespace senf { void value(value_type v) { impl::write_uint16(this->i(),v); } Parse_UInt16 const & operator= (value_type other) { value(other); return *this; } }; + template + std::ostream & operator<<(std::ostream & os, Parse_UInt16 const & i) + { os << i.value(); return os; } template struct Parse_Int24 @@ -151,6 +164,9 @@ namespace senf { void value(value_type v) { impl::write_uint24(this->i(),v); } Parse_Int24 const & operator= (value_type other) { value(other); return *this; } }; + template + std::ostream & operator<<(std::ostream & os, Parse_Int24 const & i) + { os << i.value(); return os; } template struct Parse_UInt24 @@ -174,6 +190,9 @@ namespace senf { void value(value_type v) { impl::write_uint24(this->i(),v); } Parse_UInt24 const & operator= (value_type other) { value(other); return *this; } }; + template + std::ostream & operator<<(std::ostream & os, Parse_UInt24 const & i) + { os << i.value(); return os; } template struct Parse_Int32 @@ -197,6 +216,9 @@ namespace senf { void value(value_type v) { impl::write_uint32(this->i(),v); } Parse_Int32 const & operator= (value_type other) { value(other); return *this; } }; + template + std::ostream & operator<<(std::ostream & os, Parse_Int32 const & i) + { os << i.value(); return os; } template struct Parse_UInt32 @@ -220,6 +242,9 @@ namespace senf { void value(value_type v) { impl::write_uint32(this->i(),v); } Parse_UInt32 const & operator= (value_type other) { value(other); return *this; } }; + template + std::ostream & operator<<(std::ostream & os, Parse_UInt32 const & i) + { os << i.value(); return os; } template struct Parse_IntField @@ -251,6 +276,9 @@ namespace senf { BOOST_STATIC_ASSERT( start + std::ostream & operator<<(std::ostream & os, Parse_IntField const & i) + { os << i.value(); return os; } template struct Parse_UIntField @@ -278,6 +306,9 @@ namespace senf { BOOST_STATIC_ASSERT( start + std::ostream & operator<<(std::ostream & os, Parse_UIntField const & i) + { os << i.value(); return os; } template struct Parse_Flag @@ -304,6 +335,9 @@ namespace senf { } Parse_Flag const & operator= (value_type other) { value(other); return *this; } }; + template + std::ostream & operator<<(std::ostream & os, Parse_Flag const & i) + { os << i.value(); return os; } }