Merge commit 'd16b2c9670d1849a360b94d581250aa1796d4abd'
This commit is contained in:
commit
2eb30e732d
@ -310,9 +310,10 @@ template<typename T>
|
||||
inline bool Stream::Read(std::vector<T> *out_vec) {
|
||||
uint64_t sz;
|
||||
if (this->Read(&sz, sizeof(sz)) == 0) return false;
|
||||
out_vec->resize(static_cast<size_t>(sz));
|
||||
size_t size = static_cast<size_t>(sz);
|
||||
out_vec->resize(size);
|
||||
if (sz != 0) {
|
||||
if (this->Read(&(*out_vec)[0], sizeof(T) * sz) == 0) return false;
|
||||
if (this->Read(&(*out_vec)[0], sizeof(T) * size) == 0) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -326,9 +327,10 @@ inline void Stream::Write(const std::string &str) {
|
||||
inline bool Stream::Read(std::string *out_str) {
|
||||
uint64_t sz;
|
||||
if (this->Read(&sz, sizeof(sz)) == 0) return false;
|
||||
out_str->resize(static_cast<size_t>(sz));
|
||||
size_t size = static_cast<size_t>(sz);
|
||||
out_str->resize(size);
|
||||
if (sz != 0) {
|
||||
if (this->Read(&(*out_str)[0], sizeof(char) * sz) == 0) {
|
||||
if (this->Read(&(*out_str)[0], sizeof(char) * size) == 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user