add PIChunkStream::getData(int id)
fix some COM on Windows fix PIPacketExtractor
This commit is contained in:
@@ -144,6 +144,18 @@ public:
|
||||
return ret;
|
||||
}
|
||||
|
||||
//! \~english Returns value of chunk with ID \"id\". You should call \a readAll() before using this function!
|
||||
//! \~russian Возвращает значение чанка с ID \"id\". Необходимо вызвать \a readAll() перед использованием этого метода!
|
||||
template<typename T>
|
||||
T getData(int id) const {
|
||||
T ret{};
|
||||
CacheEntry pos = data_map.value(id);
|
||||
if (pos.start < 0 || pos.length == 0) return ret;
|
||||
PIByteArray ba(data_->data(pos.start), pos.length);
|
||||
if (!ba.isEmpty()) ba >> ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
//! \~english Place value of last readed chunk into \"v\"
|
||||
//! \~russian Записывает значение последнего прочитанного чанка в \"v\"
|
||||
template<typename T>
|
||||
|
||||
Reference in New Issue
Block a user