30 #ifndef __ZMQ_BLOB_HPP_INCLUDED__ 31 #define __ZMQ_BLOB_HPP_INCLUDED__ 40 #if (defined(__GNUC__) && (__GNUC__ >= 3) && (__GNUC__ <= 4)) 44 struct char_traits<unsigned char>
46 typedef unsigned char char_type;
48 typedef unsigned long int_type;
49 typedef streampos pos_type;
50 typedef streamoff off_type;
51 typedef mbstate_t state_type;
54 assign(char_type& __c1,
const char_type& __c2)
58 eq(
const char_type& __c1,
const char_type& __c2)
59 {
return __c1 == __c2; }
62 lt(
const char_type& __c1,
const char_type& __c2)
63 {
return __c1 < __c2; }
66 compare(
const char_type* __s1,
const char_type* __s2,
size_t __n)
68 for (
size_t __i = 0; __i < __n; ++__i)
69 if (!eq(__s1[__i], __s2[__i]))
70 return lt(__s1[__i], __s2[__i]) ? -1 : 1;
75 length(
const char_type* __s)
77 const char_type* __p = __s;
83 static const char_type*
84 find(
const char_type* __s,
size_t __n,
const char_type& __a)
86 for (
const char_type* __p = __s; size_t(__p - __s) < __n; ++__p)
87 if (*__p == __a)
return __p;
92 move(char_type* __s1,
const char_type* __s2,
size_t __n)
93 {
return (char_type*) memmove(__s1, __s2, __n *
sizeof(char_type)); }
96 copy(char_type* __s1,
const char_type* __s2,
size_t __n)
97 {
return (char_type*) memcpy(__s1, __s2, __n *
sizeof(char_type)); }
100 assign(char_type* __s,
size_t __n, char_type __a)
102 for (char_type* __p = __s; __p < __s + __n; ++__p)
108 to_char_type(
const int_type& __c)
109 {
return char_type(__c); }
112 to_int_type(
const char_type& __c) {
return int_type(__c); }
115 eq_int_type(
const int_type& __c1,
const int_type& __c2)
116 {
return __c1 == __c2; }
119 eof() {
return static_cast<int_type
>(-1); }
122 not_eof(
const int_type& __c)
123 {
return eq_int_type(__c, eof()) ? int_type(0) : __c; }
127 #endif // GCC version 3 134 typedef std::basic_string <unsigned char>
blob_t;
std::basic_string< unsigned char > blob_t