149 std::size_t nRecSize = 0 );
167 void SetRecHeader( sal_uInt16 nRecId, std::size_t nRecSize );
197template<
typename Type >
228template<
typename Type >
231 if( mnAttribute == -1 )
233 rStrm.WriteAttributes(mnAttribute, OUString::number(
maValue));
239template<
typename Type >
284 sal_uInt16 nRecId,
const void* pRecData, std::size_t nRecSize );
287 void SetData(
const void* pRecData, std::size_t nRecSize );
303 sal_uInt16 nRecId, std::size_t nRecSize );
320template<
typename RecType = XclExpRecordBase >
337 {
return maRecs.empty() ? nullptr :
maRecs.front().get(); }
340 {
return maRecs.empty() ? nullptr :
maRecs.back().get(); }
349 {
if (pRec)
maRecs.push_back( pRec ); }
351 {
if (xRec)
maRecs.push_back( xRec.get() ); }
353 {
if (xRec)
maRecs.push_back( std::move(xRec) ); }
362 { assert(pRec);
maRecs.push_back( pRec ); }
366 { assert(xRec);
maRecs.append(std::move(xRec)); }
378 for(
typename RecordVec::iterator aIt =
maRecs.begin(), aEnd =
maRecs.end(); aIt != aEnd; ++aIt )
379 (*aIt)->Save(
rStrm );
385 for(
typename RecordVec::iterator aIt =
maRecs.begin(), aEnd =
maRecs.end(); aIt != aEnd; ++aIt )
386 (*aIt)->SaveXml(
rStrm );
Record which contains a Boolean value.
XclExpBoolRecord(sal_uInt16 nRecId, bool bValue, sal_Int32 nAttribute=-1)
sal_Int32 mnAttribute
The record data.
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record.
bool GetBool() const
Returns the Boolean value of the record.
virtual void SaveXml(XclExpXmlStream &rStrm) override
XclExpRecordBase * mpRecord
virtual ~XclExpDelegatingRecord() override
XclExpDelegatingRecord(XclExpRecordBase *pRecord)
virtual void SaveXml(XclExpXmlStream &rStrm) override
Record which exports a memory data array.
void SetData(const void *pRecData, std::size_t nRecSize)
Sets a data array.
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record.
XclExpDummyRecord(sal_uInt16 nRecId, const void *pRecData, std::size_t nRecSize)
XclExpEmptyRecord(sal_uInt16 nRecId)
XclExpFutureRecord(XclFutureRecType eRecType, sal_uInt16 nRecId, std::size_t nRecSize)
XclFutureRecType meRecType
virtual void Save(XclExpStream &rStrm) override
Writes the extended record header and calls WriteBody().
Base class for all Excel records.
virtual void SaveXml(XclExpXmlStream &rStrm)
XclExpRecordBase & operator=(XclExpRecordBase const &)
XclExpRecordBase & operator=(XclExpRecordBase &&) noexcept
virtual ~XclExpRecordBase()
XclExpRecordBase(XclExpRecordBase &&)
virtual void Save(XclExpStream &rStrm)
Overwrite this method to do any operation while saving the record.
XclExpRecordBase(XclExpRecordBase const &)
A list of Excel record objects.
void AppendRecord(const RecordRefType &xRec)
RecType * GetLastRecord() const
Returns reference to the last existing record or empty reference, if list is empty.
void AppendRecord(RecordRefType xRec) &&
void AppendNewRecord(RecordRefType xRec) &&
RecType * GetFirstRecord() const
Returns reference to the first existing record or empty reference, if list is empty.
void ReplaceRecord(RecordRefType const &xRec, size_t nPos)
virtual void SaveXml(XclExpXmlStream &rStrm) override
rtl::Reference< RecType > RecordRefType
void AppendNewRecord(RecType *pRec)
Appends a newly created record to the list.
bool HasRecord(size_t nPos) const
Returns true, if the passed index points to an exiting record.
::std::vector< RecordRefType > RecordVec
void RemoveRecord(size_t nPos)
Removes the record at the specified position from the list.
void InvalidateRecord(size_t nPos)
Optimization for repeated removal.
void InsertRecord(RecType *pRec, size_t nPos)
Inserts a record at the specified position into the list.
void ReplaceRecord(RecType *pRec, size_t nPos)
Replaces the record at the specified position from the list with the passed record.
void RemoveAllRecords()
Removes all records from the list.
void AppendNewRecord(RecordRefType const &xRec)
virtual void Save(XclExpStream &rStrm) override
Writes the complete record list.
void InsertRecord(RecordRefType pRec, size_t nPos)
void AppendRecord(RecType *pRec)
Appends a record to the list.
void RemoveInvalidatedRecords()
RecType * GetRecord(size_t nPos) const
Returns reference to an existing record or empty reference on error.
Base class for single records with any content.
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
XclExpRecord(sal_uInt16 nRecId=EXC_ID_UNKNOWN, std::size_t nRecSize=0)
sal_uInt16 GetRecId() const
Returns the current record ID.
sal_uInt16 mnRecId
The predicted record size.
void SetRecHeader(sal_uInt16 nRecId, std::size_t nRecSize)
Sets record ID and size with one call.
virtual void WriteBody(XclExpStream &rStrm)
Writes the body of the record (without record header).
void AddRecSize(std::size_t nRecSize)
Adds a size value to the record size prediction.
void SetRecSize(std::size_t nRecSize)
Sets a new record size prediction.
void SetRecId(sal_uInt16 nRecId)
Sets a new record ID.
XclExpRecord(XclExpRecord const &)=default
virtual ~XclExpRecord() override
std::size_t GetRecSize() const
Returns the current record size prediction.
This class is used to export Excel record streams.
Represents a complete substream of records enclosed into a pair of BOF/EOF records.
XclExpSubStream(sal_uInt16 nSubStrmType)
virtual void Save(XclExpStream &rStrm) override
Writes the complete substream, including leading BOF and trailing EOF.
A record with a single value of type Type.
const Type & GetValue() const
Returns the value of the record.
sal_Int32 mnAttribute
The record data.
XclExpValueRecord * SetAttribute(sal_Int32 nId)
Sets the OOXML attribute this record corresponds to.
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record.
XclExpValueRecord(sal_uInt16 nRecId, const Type &rValue, std::size_t nSize=sizeof(Type))
void SetValue(const Type &rValue)
Sets a new record value.
void SaveXml(XclExpXmlStream &rStrm) override
Write the OOXML attribute and its value.
virtual ~XclExpXmlElementRecord() override
XclExpXmlElementRecord(sal_Int32 nElement)
XclExpXmlEndElementRecord(sal_Int32 nElement)
virtual ~XclExpXmlEndElementRecord() override
virtual void SaveXml(XclExpXmlStream &rStrm) override
Ends the element nElement.
virtual ~XclExpXmlEndSingleElementRecord() override
XclExpXmlEndSingleElementRecord()
virtual void SaveXml(XclExpXmlStream &rStrm) override
Ends the single element nElement.
virtual void SaveXml(XclExpXmlStream &rStrm) override
Starts the element nElement.
XclExpXmlStartElementRecord(sal_Int32 nElement)
virtual ~XclExpXmlStartElementRecord() override
XclExpXmlStartSingleElementRecord(sal_Int32 nElement)
virtual void SaveXml(XclExpXmlStream &rStrm) override
Starts the single element nElement.
virtual ~XclExpXmlStartSingleElementRecord() override
XclExpValueRecord< double > XclExpDoubleRecord
A record containing a double value.
XclExpValueRecord< sal_uInt16 > XclExpUInt16Record
A record containing an unsigned 16-bit value.
XclFutureRecType
Enumerates different header types of future records.
const sal_uInt16 EXC_ID_UNKNOWN