|
|
@ -450,7 +450,7 @@ public: |
|
|
|
} |
|
|
|
} |
|
|
|
string.resize(size); |
|
|
|
string.resize(size); |
|
|
|
if (size != 0) |
|
|
|
if (size != 0) |
|
|
|
s.read((char*)&string[0], size); |
|
|
|
s.read((char*)string.data(), size); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
template<typename Stream> |
|
|
|
template<typename Stream> |
|
|
@ -458,7 +458,7 @@ public: |
|
|
|
{ |
|
|
|
{ |
|
|
|
WriteCompactSize(s, string.size()); |
|
|
|
WriteCompactSize(s, string.size()); |
|
|
|
if (!string.empty()) |
|
|
|
if (!string.empty()) |
|
|
|
s.write((char*)&string[0], string.size()); |
|
|
|
s.write((char*)string.data(), string.size()); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -556,7 +556,7 @@ void Serialize(Stream& os, const std::basic_string<C>& str) |
|
|
|
{ |
|
|
|
{ |
|
|
|
WriteCompactSize(os, str.size()); |
|
|
|
WriteCompactSize(os, str.size()); |
|
|
|
if (!str.empty()) |
|
|
|
if (!str.empty()) |
|
|
|
os.write((char*)&str[0], str.size() * sizeof(str[0])); |
|
|
|
os.write((char*)str.data(), str.size() * sizeof(C)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
template<typename Stream, typename C> |
|
|
|
template<typename Stream, typename C> |
|
|
@ -565,7 +565,7 @@ void Unserialize(Stream& is, std::basic_string<C>& str) |
|
|
|
unsigned int nSize = ReadCompactSize(is); |
|
|
|
unsigned int nSize = ReadCompactSize(is); |
|
|
|
str.resize(nSize); |
|
|
|
str.resize(nSize); |
|
|
|
if (nSize != 0) |
|
|
|
if (nSize != 0) |
|
|
|
is.read((char*)&str[0], nSize * sizeof(str[0])); |
|
|
|
is.read((char*)str.data(), nSize * sizeof(C)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -578,7 +578,7 @@ void Serialize_impl(Stream& os, const prevector<N, T>& v, const unsigned char&) |
|
|
|
{ |
|
|
|
{ |
|
|
|
WriteCompactSize(os, v.size()); |
|
|
|
WriteCompactSize(os, v.size()); |
|
|
|
if (!v.empty()) |
|
|
|
if (!v.empty()) |
|
|
|
os.write((char*)&v[0], v.size() * sizeof(T)); |
|
|
|
os.write((char*)v.data(), v.size() * sizeof(T)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
template<typename Stream, unsigned int N, typename T, typename V> |
|
|
|
template<typename Stream, unsigned int N, typename T, typename V> |
|
|
@ -646,7 +646,7 @@ void Serialize_impl(Stream& os, const std::vector<T, A>& v, const unsigned char& |
|
|
|
{ |
|
|
|
{ |
|
|
|
WriteCompactSize(os, v.size()); |
|
|
|
WriteCompactSize(os, v.size()); |
|
|
|
if (!v.empty()) |
|
|
|
if (!v.empty()) |
|
|
|
os.write((char*)&v[0], v.size() * sizeof(T)); |
|
|
|
os.write((char*)v.data(), v.size() * sizeof(T)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
template<typename Stream, typename T, typename A, typename V> |
|
|
|
template<typename Stream, typename T, typename A, typename V> |
|
|
|