59#include <osl/diagnose.h>
60#include <rtl/string.hxx>
76 *ppContainer =
nullptr;
78 if (
nullptr == pStream)
83 std::unique_ptr<LtcBenContainer> pContainer(
new LtcBenContainer(pStream));
89 *ppContainer = std::move(pContainer);
115 sPropertyName, &pPrevNamedObjectListElmt);
117 if (pNamedObject !=
nullptr)
130 pPrevObject, sPropertyName, pPrevNamedObjectListElmt);
145 while ((pCurrObject =
GetNextObject(pCurrObject)) !=
nullptr)
146 if (pCurrObject->
UseProperty(PropertyID) !=
nullptr)
158 : cNextAvailObjectID(0)
249 void readDataInBlocks(
SvStream& rSt, sal_uInt64 nDLen, std::vector<sal_uInt8>& rData)
255 size_t nOldSize = rData.size();
256 size_t nBlock = std::min<size_t>(SAL_MAX_UINT16, nDLen - nOldSize);
257 rData.resize(nOldSize + nBlock);
258 size_t nReadBlock = rSt.
ReadBytes(rData.data() + nOldSize, nBlock);
259 if (nBlock != nReadBlock)
261 rData.resize(nOldSize + nReadBlock);
274 std::vector<sal_uInt8>
aData;
280 OString sSName=OString::Concat(pObjectName) +
"-S";
281 OString sDName=OString::Concat(pObjectName) +
"-D";
288 sal_uInt64 nDLen = 0;
291 nDLen = xD->TellEnd();
293 sal_uInt64 nSLen = 0;
296 nSLen = xS->TellEnd();
299 sal_uInt64 nLen = nDLen + nSLen;
300 OSL_ENSURE(nLen > 0,
"expected a non-0 length");
309 readDataInBlocks(*xD, nDLen,
aData);
314 readDataInBlocks(*xS, nSLen,
aData);
const char * pPropertyName
encapsulate XInputStream to provide SvStream like interfaces
sal_Int64 Seek(sal_Int64 pos)
@descr Seek to pos
void SeekRel(sal_Int64 pos)
@descr SeekRel in stream
sal_Int64 Tell()
@descr Get the current position in stream
size_t Read(void *bytes, size_t nBytesToRead)
@descr read nBytesToRead bytes to buf
virtual bool IsPropertyName()
CBenProperty * UseProperty(BenObjectID PropertyID)
CBenValue * UseValue(BenObjectID PropertyID)
BenError ReadLabelAndTOC()
CUtListElmt * GetNextOrNULL(CUtListElmt const *pCurr)
std::vector< sal_uInt8 > GetGraphicData(const char *pObjectName)
Find hazily according to object ID.
sal_uLong remainingSize() const
BenError ReadKnownSize(void *pBuffer, size_t Amt)
Read buffer from bento file with specified size.
LtcUtBenValueStream * FindNextValueStreamWithPropertyName(const char *sPropertyName)
Find the next value stream with property name.
BenObjectID cNextAvailObjectID
LtcBenContainer(LwpSvStream *pStream)
Construction.
LtcUtBenValueStream * FindValueStreamWithPropertyName(const char *sPropertyName)
Find the unique value stream with property name.
CBenObject * GetNextObject(CBenObject const *pCurrObject)
void SeekToPosition(BenContainerPos Pos)
Seek to position from the beginning of the bento file.
CBenObject * FindNextObjectWithProperty(CBenObject *pCurrObject, BenObjectID PropertyID)
void RegisterPropertyName(const char *sPropertyName, CBenPropertyName **ppPropertyName)
void Read(void *pBuffer, size_t MaxSize, size_t *pAmtRead)
Read buffer for bento file with specified buffer.
void SeekFromEnd(tools::Long Offset)
Seek to position compare to end of bento file.
std::size_t ReadBytes(void *pData, std::size_t nSize)
CBenIDListElmt * FindID(CUtList *pList, BenObjectID ObjectID, CUtListElmt **ppPrev)
const char gsBenMagicBytes[]
sal_uLong BenOpenContainer(LwpSvStream *pStream, std::unique_ptr< LtcBenContainer > *ppContainer)
New bento container from file stream.
@ BenErr_ContainerWithNoObjects
@ BenErr_ReadPastEndOfContainer
CBenNamedObject * FindNamedObject(CUtList *pList, std::string_view rName, CUtListElmt **ppPrev)
sal_uInt32 BenContainerPos
constexpr OUStringLiteral aData
#define STREAM_SEEK_TO_END
#define STREAM_SEEK_TO_BEGIN