Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _TYPES_H_
00020 #define _TYPES_H_
00021
00022 #include <string>
00023 #include <istream>
00024 #include <ostream>
00025
00026 typedef unsigned char uint8_t;
00027 typedef unsigned short uint16_t;
00028 typedef unsigned int uint32_t;
00029 typedef signed int int32_t;
00030 typedef unsigned long long uint64_t;
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 typedef unsigned char byte_t;
00041
00042
00043
00044
00045 class data_t : public std::basic_string<byte_t> { };
00046
00047 inline std::ostream& operator<<(std::ostream& out, const data_t& stream)
00048 {
00049 out << "+----------+----------+----------+----------+" << std::endl;
00050 out << "| ";
00051 for(size_t i = 0; i < stream.size(); i++)
00052 {
00053 out.width(8);
00054 out << (int)stream[i] << " | ";
00055 if( (i+1)%4 == 0 )
00056 {
00057 out << std::endl;
00058 out << "+----------+----------+----------+----------+";
00059 if( i != stream.size() - 1 )
00060 {
00061
00062 out << std::endl << "| ";
00063 }
00064 }
00065 }
00066 out << std::endl;
00067
00068 return out;
00069 }
00070
00071 #endif