20 #ifndef INCLUDED_SC_SOURCE_FILTER_INC_XERECORD_HXX
21 #define INCLUDED_SC_SOURCE_FILTER_INC_XERECORD_HXX
27 #include <rtl/ref.hxx>
149 std::size_t nRecSize = 0 );
167 void SetRecHeader( sal_uInt16 nRecId, std::size_t nRecSize );
197 template<
typename Type >
228 template<
typename Type >
231 if( mnAttribute == -1 )
239 template<
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 );
320 template<
typename RecType = XclExpRecordBase >
331 {
return nPos <
maRecs.size(); }
334 {
return nPos <
maRecs.size() ?
maRecs[ nPos ].get() :
nullptr; }
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) ); }
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 );
void SetValue(const Type &rValue)
Sets a new record value.
XclExpDummyRecord(sal_uInt16 nRecId, const void *pRecData, std::size_t nRecSize)
void WriteAttributes(sal_Int32 nAttribute, Str &&value, Args &&...rest)
rtl::Reference< RecType > RecordRefType
virtual void Save(XclExpStream &rStrm) override
Writes the complete substream, including leading BOF and trailing EOF.
virtual void Save(XclExpStream &rStrm) override
Writes the complete record list.
virtual ~XclExpXmlElementRecord() override
void ReplaceRecord(RecordRefType const &xRec, size_t nPos)
A list of Excel record objects.
XclExpXmlStartElementRecord(sal_Int32 nElement)
sal_Int32 mnAttribute
The record data.
Represents a complete substream of records enclosed into a pair of BOF/EOF records.
This class is used to export Excel record streams.
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record.
virtual void SaveXml(XclExpXmlStream &rStrm) override
void SetData(const void *pRecData, std::size_t nRecSize)
Sets a data array.
XclExpValueRecord< double > XclExpDoubleRecord
A record containing a double value.
void AppendRecord(RecType *pRec)
Appends a record to the list.
XclExpFutureRecord(XclFutureRecType eRecType, sal_uInt16 nRecId, std::size_t nRecSize)
const Type & GetValue() const
Returns the value of the record.
void SetRecSize(std::size_t nRecSize)
Sets a new record size prediction.
virtual ~XclExpXmlEndSingleElementRecord() override
std::size_t GetRecSize() const
Returns the current record size prediction.
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record.
void ReplaceRecord(RecType *pRec, size_t nPos)
Replaces the record at the specified position from the list with the passed record.
XclFutureRecType
Enumerates different header types of future records.
sal_uInt16 GetRecId() const
Returns the current record ID.
XclExpRecordBase & operator=(XclExpRecordBase &&) noexcept
RecType * GetLastRecord() const
Returns reference to the last existing record or empty reference, if list is empty.
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
Record which exports a memory data array.
XclExpSubStream(sal_uInt16 nSubStrmType)
XclExpRecordBase & operator=(XclExpRecordBase const &)
Base class for all Excel records.
bool HasRecord(size_t nPos) const
Returns true, if the passed index points to an exiting record.
virtual void Save(XclExpStream &rStrm)
Overwrite this method to do any operation while saving the record.
XclExpValueRecord(sal_uInt16 nRecId, const Type &rValue, std::size_t nSize=sizeof(Type))
XclExpRecordBase(XclExpRecordBase &&)
void AppendRecord(RecordRefType xRec)&&
XclExpXmlEndSingleElementRecord()
A record with a single value of type Type.
void AppendNewRecord(RecordRefType xRec)&&
void RemoveRecord(size_t nPos)
Removes the record at the specified position from the list.
XclExpXmlElementRecord(sal_Int32 nElement)
const sal_uInt16 EXC_ID_UNKNOWN
void AppendNewRecord(RecordRefType const &xRec)
void InsertRecord(RecType *pRec, size_t nPos)
Inserts a record at the specified position into the list.
virtual void SaveXml(XclExpXmlStream &rStrm) override
Ends the element nElement.
void InsertRecord(RecordRefType pRec, size_t nPos)
XclExpRecordBase * mpRecord
void AppendRecord(const RecordRefType &xRec)
virtual ~XclExpRecordBase()
RecType * GetFirstRecord() const
Returns reference to the first existing record or empty reference, if list is empty.
virtual void SaveXml(XclExpXmlStream &rStrm) override
sal_uInt16 mnRecId
The predicted record size.
virtual ~XclExpXmlStartSingleElementRecord() override
void AppendNewRecord(RecType *pRec)
Appends a newly created record to the list.
bool GetBool() const
Returns the Boolean value of the record.
XclFutureRecType meRecType
XclExpValueRecord< sal_uInt16 > XclExpUInt16Record
A record containing an unsigned 16-bit value.
virtual void SaveXml(XclExpXmlStream &rStrm) override
Ends the single element nElement.
virtual void WriteBody(XclExpStream &rStrm)
Writes the body of the record (without record header).
RecType * GetRecord(size_t nPos) const
Returns reference to an existing record or empty reference on error.
XclExpRecordBase(XclExpRecordBase const &)
void SetRecHeader(sal_uInt16 nRecId, std::size_t nRecSize)
Sets record ID and size with one call.
XclExpRecord(sal_uInt16 nRecId=EXC_ID_UNKNOWN, std::size_t nRecSize=0)
XclExpDelegatingRecord(XclExpRecordBase *pRecord)
void SaveXml(XclExpXmlStream &rStrm) override
Write the OOXML attribute and its value.
void RemoveAllRecords()
Removes all records from the list.
XclExpEmptyRecord(sal_uInt16 nRecId)
virtual ~XclExpXmlEndElementRecord() override
XclExpValueRecord * SetAttribute(sal_Int32 nId)
Sets the OOXML attribute this record corresponds to.
virtual void Save(XclExpStream &rStrm) override
Writes the extended record header and calls WriteBody().
virtual ~XclExpXmlStartElementRecord() override
virtual ~XclExpDelegatingRecord() override
sal_Int32 mnAttribute
The record data.
XclExpXmlEndElementRecord(sal_Int32 nElement)
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record.
virtual void SaveXml(XclExpXmlStream &rStrm) override
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
XclExpXmlStartSingleElementRecord(sal_Int32 nElement)
void SetRecId(sal_uInt16 nRecId)
Sets a new record ID.
virtual void SaveXml(XclExpXmlStream &rStrm) override
Starts the single element nElement.
virtual void SaveXml(XclExpXmlStream &rStrm)
Base class for single records with any content.
Record which contains a Boolean value.
::std::vector< RecordRefType > RecordVec
virtual void SaveXml(XclExpXmlStream &rStrm) override
Starts the element nElement.
XclExpBoolRecord(sal_uInt16 nRecId, bool bValue, sal_Int32 nAttribute=-1)
virtual ~XclExpRecord() override
void AddRecSize(std::size_t nRecSize)
Adds a size value to the record size prediction.