16 template<
typename Storage = std::pair<u
int64_t,u
int64_t> >
20 memset( (
char*)&data, 0,
sizeof(data) );
25 if( str.size() <
sizeof(data) ) {
26 memset( (
char*)&data, 0,
sizeof(data) );
27 memcpy( (
char*)&data, str.c_str(), str.size() );
29 memcpy( (
char*)&data, str.c_str(),
sizeof(data) );
33 memset( (
char*)&data, 0,
sizeof(data) );
35 if(
l <
sizeof(data) ) {
36 memset( (
char*)&data, 0,
sizeof(data) );
40 memcpy( (
char*)&data, str,
sizeof(data) );
44 operator std::string()
const {
45 const char* self = (
const char*)&data;
46 return std::string( self, self +
size() );
50 if( *(((
const char*)&data)+
sizeof(data) - 1) )
52 return strnlen( (
const char*)&data,
sizeof(data) );
65 if( str.size() <
sizeof(data) ) {
66 memset( (
char*)&data, 0,
sizeof(data) );
67 memcpy( (
char*)&data, str.c_str(), str.size() );
70 memcpy( (
char*)&data, str.c_str(),
sizeof(data) );
76 return std::string(
a) + b;
79 return a + std::string(b);
83 return a.data < b.data;
86 return a.data <= b.data;
89 return a.data > b.data;
92 return a.data >= b.data;
95 return a.data == b.data;
98 return a.data != b.data;
102 return out << std::string(str);
110 template<
typename Stream,
typename Storage>
114 s.write( (
const char*)&u.
data, size );
117 template<
typename Stream,
typename Storage>
121 if( size.
value > 0 ) {
122 if( size.
value >
sizeof(Storage) ) {
123 s.read( (
char*)&u.
data,
sizeof(Storage) );
125 size_t left = size.
value -
sizeof(Storage);
126 while( left >= 1024 )
162 template<
typename Storage>
167 template<
typename Storage>
friend bool operator>(const fixed_string &a, const fixed_string &b)
fixed_string & operator=(const std::string &str)
fixed_string & operator=(const char *str)
friend bool operator<(const fixed_string &a, const fixed_string &b)
fixed_string(const char *str)
fixed_string & operator=(const fixed_string &str)
friend bool operator==(const fixed_string &a, const fixed_string &b)
friend bool operator<=(const fixed_string &a, const fixed_string &b)
friend std::ostream & operator<<(std::ostream &out, const fixed_string &str)
friend std::string operator+(const fixed_string &a, const std::string &b)
friend bool operator>=(const fixed_string &a, const fixed_string &b)
fixed_string(const std::string &str)
friend bool operator!=(const fixed_string &a, const fixed_string &b)
fixed_string(const fixed_string &c)
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Concept for reading and writing characters.
void unpack(Stream &s, std::deque< T > &value)
void pack(Stream &s, const std::deque< T > &value)
void from_variant(const fc::variant &v, sysio::chain::chain_id_type &cid)
void to_variant(const sysio::chain::shared_public_key &var, fc::variant &vo)
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
memset(pInfo->slotDescription, ' ', 64)
memcpy((char *) pInfo->slotDescription, s, l)