21#include <osl/diagnose.h>
38 OSL_ENSURE( nRecSize == 4,
"VbaHelper::readDirRecord - unexpected record size for PROJECTVERSION" );
42 return !rInStrm.
isEof() && (rInStrm.
readData( rRecData, nRecSize ) == nRecSize);
47 size_t nEqSignPos = rKeyValue.find(
'=' );
48 if( nEqSignPos > 0 && nEqSignPos != std::u16string_view::npos )
50 rKey =
o3tl::trim(rKeyValue.substr( 0, nEqSignPos ));
51 rValue =
o3tl::trim(rKeyValue.substr( nEqSignPos + 1 ));
52 return !rKey.isEmpty() && !rValue.isEmpty();
bool isEof() const
Returns true, if the stream position is invalid (EOF).
std::basic_string_view< charT, traits > trim(std::basic_string_view< charT, traits > str)
bool readDirRecord(sal_uInt16 &rnRecId, StreamDataSequence &rRecData, BinaryInputStream &rInStrm)
Reads the next record from the VBA directory stream 'dir'.
bool extractKeyValue(OUString &rKey, OUString &rValue, std::u16string_view rKeyValue)
Extracts a key/value pair from a string separated by an equality sign.
const sal_uInt16 VBA_ID_PROJECTVERSION
css::uno::Sequence< sal_Int8 > StreamDataSequence