PIBinaryStream patches

This commit is contained in:
2022-11-14 12:31:20 +03:00
parent 57ed40912d
commit 05dcbca894
2 changed files with 11 additions and 2 deletions

View File

@@ -3,7 +3,7 @@ cmake_policy(SET CMP0017 NEW) # need include() with .cmake
project(PIP)
set(PIP_MAJOR 3)
set(PIP_MINOR 6)
set(PIP_REVISION 0)
set(PIP_REVISION 1)
set(PIP_SUFFIX )
set(PIP_COMPANY SHS)
set(PIP_DOMAIN org.SHS)

View File

@@ -82,7 +82,7 @@ public:
//!\~\details
//!\~russian Возвращает -1 если нет информации о размере
ssize_t binaryStreamSize() const {
return static_cast<P*>(this)->binaryStreamSizeImp();
return static_cast<const P*>(this)->binaryStreamSizeImp();
}
//! \~russian Записать данные
@@ -116,6 +116,15 @@ template<typename P, typename T> inline PIBinaryStream<P> & operator >>(PIBinary
return s.p;
}
template<typename P> inline PIBinaryStream<P> & operator <<(PIBinaryStreamTrivialRef<P> s, const PIMemoryBlock v) {
s.p << v;
return s.p;
}
template<typename P> inline PIBinaryStream<P> & operator >>(PIBinaryStreamTrivialRef<P> s, PIMemoryBlock v) {
s.p >> v;
return s.p;
}
// specify types
template<typename P> inline PIBinaryStream<P> & operator <<(PIBinaryStream<P> & s, const bool v) {