LibreOffice Module sc (master) 1
|
This class is used to import record oriented streams. More...
#include <xistream.hxx>
Public Member Functions | |
XclImpStream (SvStream &rInStrm, const XclImpRoot &rRoot) | |
Constructs the Excel record import stream using a TOOLS stream object. More... | |
~XclImpStream () | |
const XclImpRoot & | GetRoot () const |
Returns the filter root data. More... | |
bool | StartNextRecord () |
Sets stream pointer to the start of the next record content. More... | |
bool | StartNextRecord (std::size_t nNextRecPos) |
Sets stream pointer to the start of the record content for the record at the passed absolute stream position. More... | |
void | ResetRecord (bool bContLookup, sal_uInt16 nAltContId=EXC_ID_UNKNOWN) |
Sets stream pointer to begin of record content. More... | |
void | RewindRecord () |
Sets stream pointer before current record and invalidates stream. More... | |
void | SetDecrypter (XclImpDecrypterRef const &xDecrypter) |
Enables decryption of record contents for the rest of the stream. More... | |
void | CopyDecrypterFrom (const XclImpStream &rStrm) |
Sets decrypter from another stream. More... | |
void | EnableDecryption (bool bEnable=true) |
Switches usage of current decryption algorithm on/off. More... | |
void | DisableDecryption () |
Switches usage of current decryption algorithm off. More... | |
void | PushPosition () |
Pushes current position on user position stack. More... | |
void | PopPosition () |
Seeks to last position from user position stack. More... | |
void | StoreGlobalPosition () |
Stores current position. More... | |
void | SeekGlobalPosition () |
Seeks to the stored global user position. More... | |
bool | IsValid () const |
Returns record reading state: false = record overread. More... | |
sal_uInt16 | GetRecId () const |
Returns the current record ID. More... | |
std::size_t | GetRecPos () const |
Returns the position inside of the whole record content. More... | |
std::size_t | GetRecSize () |
Returns the data size of the whole record without record headers. More... | |
std::size_t | GetRecLeft () |
Returns remaining data size of the whole record without record headers. More... | |
sal_uInt16 | GetNextRecId () |
Returns the record ID of the following record. More... | |
sal_uInt16 | PeekRecId (std::size_t nPos) |
sal_uInt8 | ReaduInt8 () |
sal_Int16 | ReadInt16 () |
sal_uInt16 | ReaduInt16 () |
sal_Int32 | ReadInt32 () |
sal_uInt32 | ReaduInt32 () |
double | ReadDouble () |
std::size_t | Read (void *pData, std::size_t nBytes) |
Reads nBytes bytes to the existing(!) buffer pData. More... | |
std::size_t | CopyToStream (SvStream &rOutStrm, std::size_t nBytes) |
Copies nBytes bytes to rOutStrm. More... | |
void | CopyRecordToStream (SvStream &rOutStrm) |
Copies the entire record to rOutStrm. More... | |
void | Seek (std::size_t nPos) |
Seeks absolute in record content to the specified position. More... | |
void | Ignore (std::size_t nBytes) |
Seeks forward inside the current record. More... | |
std::size_t | ReadUniStringExtHeader (bool &rb16Bit, bool &rbRich, bool &rbFareast, sal_uInt16 &rnFormatRuns, sal_uInt32 &rnExtInf, sal_uInt8 nFlags) |
Reads ext. More... | |
std::size_t | ReadUniStringExtHeader (bool &rb16Bit, sal_uInt8 nFlags) |
Seeks to begin of character array, detects 8/16 bit mode. More... | |
void | SetNulSubstChar (sal_Unicode cNulSubst='?') |
Sets a replacement character for NUL characters. More... | |
OUString | ReadRawUniString (sal_uInt16 nChars, bool b16Bit) |
Reads nChars characters and returns the string. More... | |
OUString | ReadUniString (sal_uInt16 nChars, sal_uInt8 nFlags) |
Reads ext. More... | |
OUString | ReadUniString (sal_uInt16 nChars) |
Reads 8 bit flags, ext. More... | |
OUString | ReadUniString () |
Reads 16 bit character count, 8 bit flags, ext. More... | |
void | IgnoreRawUniString (sal_uInt16 nChars, bool b16Bit) |
Ignores nChars characters. More... | |
void | IgnoreUniString (sal_uInt16 nChars, sal_uInt8 nFlags) |
Ignores ext. More... | |
void | IgnoreUniString (sal_uInt16 nChars) |
Ignores 8 bit flags, ext. More... | |
OUString | ReadRawByteString (sal_uInt16 nChars) |
Reads nChar byte characters and returns the string. More... | |
OUString | ReadByteString (bool b16BitLen) |
Reads 8/16 bit string length, character array and returns the string. More... | |
std::size_t | GetSvStreamPos () const |
Returns the absolute stream position. More... | |
std::size_t | GetSvStreamSize () const |
Returns the stream size. More... | |
void | StorePosition (XclImpStreamPos &rPos) |
Stores current stream position into rPos. More... | |
void | RestorePosition (const XclImpStreamPos &rPos) |
Restores stream position contained in rPos. More... | |
void | SetSvStreamError (const ErrCode &rErrCode) |
Set an SVSTREAM_..._ERROR. More... | |
Static Public Member Functions | |
static XclBiff | DetectBiffVersion (SvStream &rStrm) |
Detects the BIFF version of the passed workbook stream. More... | |
Private Member Functions | |
bool | ReadNextRawRecHeader () |
Seeks to next raw record header and reads record ID and size. More... | |
void | SetupDecrypter () |
Initializes the decrypter to read a new record. More... | |
void | SetupRawRecord () |
Initializes all members after base stream has been sought to new raw record. More... | |
void | SetupRecord () |
Initializes all members after base stream has been sought to new record. More... | |
bool | IsContinueId (sal_uInt16 nRecId) const |
Returns true, if the passed ID is real or alternative continuation record ID. More... | |
bool | JumpToNextContinue () |
Goes to start of the next CONTINUE record. More... | |
bool | JumpToNextStringContinue (bool &rb16Bit) |
Goes to start of the next CONTINUE record while reading strings. More... | |
bool | EnsureRawReadSize (sal_uInt16 nBytes) |
Ensures that reading nBytes bytes is possible with next stream access. More... | |
sal_uInt16 | GetMaxRawReadSize (std::size_t nBytes) const |
Returns the maximum size of raw data possible to read in one block. More... | |
sal_uInt16 | ReadRawData (void *pData, sal_uInt16 nBytes) |
Reads and decrypts nBytes bytes to the existing(!) buffer pData. More... | |
Private Attributes | |
SvStream & | mrStrm |
const XclImpRoot & | mrRoot |
Reference to the system input stream. More... | |
XclImpDecrypterRef | mxDecrypter |
Filter root data. More... | |
XclImpStreamPos | maFirstRec |
Provides methods to decrypt data. More... | |
std::vector< XclImpStreamPos > | maPosStack |
Start position of current record. More... | |
XclImpStreamPos | maGlobPos |
Stack for record positions. More... | |
sal_uInt16 | mnGlobRecId |
User defined position elsewhere in stream. More... | |
bool | mbGlobValidRec |
Record ID for user defined position. More... | |
bool | mbHasGlobPos |
Was user position a valid record? More... | |
std::size_t | mnStreamSize |
Is user position defined? More... | |
std::size_t | mnNextRecPos |
Size of system stream. More... | |
std::size_t | mnCurrRecSize |
Start of next record header. More... | |
std::size_t | mnComplRecSize |
Helper for record position. More... | |
bool | mbHasComplRec |
Size of complete record data (with CONTINUEs). More... | |
sal_uInt16 | mnRecId |
true = mnComplRecSize is valid. More... | |
sal_uInt16 | mnAltContId |
Current record ID (not the CONTINUE ID). More... | |
sal_uInt16 | mnRawRecId |
Alternative record ID for content continuation. More... | |
sal_uInt16 | mnRawRecSize |
Current raw record ID (including CONTINUEs). More... | |
sal_uInt16 | mnRawRecLeft |
Current raw record size (without following CONTINUEs). More... | |
sal_Unicode | mcNulSubst |
Bytes left in current raw record (without following CONTINUEs). More... | |
bool | mbCont |
Replacement for NUL characters. More... | |
bool | mbUseDecr |
Automatic CONTINUE lookup on/off. More... | |
bool | mbValidRec |
Usage of decryption. More... | |
bool | mbValid |
false = No more records to read. More... | |
This class is used to import record oriented streams.
@descr An instance is constructed with an SvStream. The SvStream stream is reset to its start while constructing this stream.
To start reading a record call StartNextRecord(). Now it is possible to read all contents of the record using operator>>() or any of the Read***() functions. If some data exceeds the record size limit, the stream looks for a following CONTINUE record and jumps automatically to it. It is NOT allowed that an atomic data type is split into two records (i.e. 4 bytes of a double in one record and the other 4 bytes in a following CONTINUE).
Trying to read over the record limits results in a stream error. The IsValid() function indicates that with returning false. From now on it is undefined what data the read functions will return. The error state will be reset, if the record is reset (with the method ResetRecord()) or if the next record is started.
To switch off the automatic lookup of CONTINUE records, use ResetRecord() with false parameter. This is useful i.e. on import of Escher objects, where sometimes solely CONTINUE records will occur. The automatic lookup keeps switched off until the method ResetRecord() is called with parameter true. All other settings done on the stream (i.e. alternative CONTINUE record identifier, enabled decryption, NUL substitution character) will be reset to default values, if a new record is started.
The import stream supports decrypting the stream data. The contents of a record (not the record header) will be encrypted by Excel if the file has been stored with password protection. The functions SetDecrypter(), EnableDecryption(), and DisableDecryption() control the usage of the decryption algorithms. SetDecrypter() sets a new decryption algorithm and initially enables it. DisableDecryption() may be used to stop the usage of the decryption temporarily (sometimes record contents are never encrypted, i.e. all BOF records or the stream position in BOUNDSHEET). Decryption will be re-enabled automatically, if a new record is started with the function StartNextRecord().
It is possible to store several stream positions inside a record (including its CONTINUE records). The positions are stored on a stack, which can be controlled with the functions PushPosition(), PopPosition() and RejectPosition(). The stack will be cleared whenever a new record is started with the function StartNextRecord().
Additionally a single global stream position can be stored which keeps valid during the whole import process (methods StoreGlobalPosition(), SeekGlobalPosition() and DeleteGlobalPosition()). This is the only way to jump back to a previous record (that is a real jump without return).
Definition at line 277 of file xistream.hxx.
|
explicit |
Constructs the Excel record import stream using a TOOLS stream object.
rInStrm | The system input stream. Will be set to its start position. Must exist as long as this object exists |
Definition at line 427 of file xistream.cxx.
References mnStreamSize, mrStrm, SvStream::Seek(), STREAM_SEEK_TO_BEGIN, and SvStream::TellEnd().
XclImpStream::~XclImpStream | ( | ) |
Definition at line 452 of file xistream.cxx.
void XclImpStream::CopyDecrypterFrom | ( | const XclImpStream & | rStrm | ) |
Sets decrypter from another stream.
Definition at line 514 of file xistream.cxx.
References rStrm, and SetDecrypter().
Referenced by XclImpPivotCache::ReadPivotCacheStream().
void XclImpStream::CopyRecordToStream | ( | SvStream & | rOutStrm | ) |
Copies the entire record to rOutStrm.
The current record position keeps unchanged.
Definition at line 770 of file xistream.cxx.
References CopyToStream(), GetRecSize(), maFirstRec, mbValidRec, PopPosition(), PushPosition(), and RestorePosition().
std::size_t XclImpStream::CopyToStream | ( | SvStream & | rOutStrm, |
std::size_t | nBytes | ||
) |
Copies nBytes bytes to rOutStrm.
Definition at line 746 of file xistream.cxx.
References aBuffer, mbValid, Read(), SAL_WARN_IF, o3tl::sanitizing_min(), and SvStream::WriteBytes().
Referenced by CopyRecordToStream().
Detects the BIFF version of the passed workbook stream.
Definition at line 387 of file xistream.cxx.
References EXC_BIFF2, EXC_BIFF3, EXC_BIFF4, EXC_BIFF5, EXC_BIFF8, EXC_BIFF_UNKNOWN, EXC_BOF_BIFF2, EXC_BOF_BIFF3, EXC_BOF_BIFF4, EXC_BOF_BIFF5, EXC_BOF_BIFF8, EXC_ID2_BOF, EXC_ID3_BOF, EXC_ID4_BOF, EXC_ID5_BOF, SvStream::good(), nVersion, SvStream::ReadUInt16(), rStrm, SAL_WARN, SvStream::Seek(), and STREAM_SEEK_TO_BEGIN.
Referenced by ScFormatFilterPluginImpl::ScImportExcel().
|
inline |
Switches usage of current decryption algorithm off.
@descr This is a record-local setting. The function StartNextRecord() always enables decryption.
Definition at line 334 of file xistream.hxx.
References EnableDecryption().
Referenced by ImportExcel::Bof2(), ImportExcel::Bof3(), ImportExcel::Bof4(), ImportExcel::Bof5(), ImportExcel8::Boundsheet(), and ImportExcel::Boundsheet().
void XclImpStream::EnableDecryption | ( | bool | bEnable = true | ) |
Switches usage of current decryption algorithm on/off.
@descr Encryption is re-enabled automatically, if a new record is started using the function StartNextRecord().
Definition at line 522 of file xistream.cxx.
References mbUseDecr, and mxDecrypter.
Referenced by ImportExcel8::Boundsheet(), ImportExcel::Boundsheet(), DisableDecryption(), ResetRecord(), SetDecrypter(), and SetupRecord().
|
private |
Ensures that reading nBytes bytes is possible with next stream access.
@descr Stream must be located at the end of a raw record, and handling of CONTINUE records must be enabled.
Definition at line 1056 of file xistream.cxx.
References JumpToNextContinue(), mbValid, and mnRawRecLeft.
Referenced by ReadDouble(), ReadInt16(), ReadInt32(), ReaduInt16(), ReaduInt32(), and ReaduInt8().
|
private |
Returns the maximum size of raw data possible to read in one block.
Definition at line 1067 of file xistream.cxx.
References mnRawRecLeft.
Referenced by Ignore(), IgnoreRawUniString(), Read(), ReadRawByteString(), and ReadRawUniString().
sal_uInt16 XclImpStream::GetNextRecId | ( | ) |
Returns the record ID of the following record.
Definition at line 587 of file xistream.cxx.
References EXC_ID_UNKNOWN, JumpToNextContinue(), mbValidRec, mnNextRecPos, mnStreamSize, mrStrm, PopPosition(), PushPosition(), SvStream::ReadUInt16(), and SvStream::Seek().
Referenced by ImportExcel8::Read().
|
inline |
Returns the current record ID.
Definition at line 353 of file xistream.hxx.
References mnRecId.
Referenced by ImportExcel::Read(), ImportExcel8::Read(), ImportExcel::ReadBlank(), ImportExcel::ReadBoolErr(), ImportExcel::ReadDimensions(), ImportExcel::ReadLabel(), ImportExcel::ReadNumber(), and XclImpPivotCache::ReadPivotCacheStream().
std::size_t XclImpStream::GetRecLeft | ( | ) |
Returns remaining data size of the whole record without record headers.
Definition at line 582 of file xistream.cxx.
References GetRecPos(), GetRecSize(), and mbValid.
Referenced by ImportExcel::Cellmerging(), ImportExcel::Columndefault(), JumpToNextStringContinue(), ImportExcel::Mulblank(), ImportExcel::Mulrk(), and ExcelToSc::ReadExtensionArray().
std::size_t XclImpStream::GetRecPos | ( | ) | const |
Returns the position inside of the whole record content.
Definition at line 564 of file xistream.cxx.
References EXC_REC_SEEK_TO_END, mbValid, mnCurrRecSize, and mnRawRecLeft.
Referenced by ExcelToSc::Convert(), ExcelToSc8::Convert(), ExcelToSc8::GetAbsRefs(), GetRecLeft(), and Seek().
std::size_t XclImpStream::GetRecSize | ( | ) |
Returns the data size of the whole record without record headers.
Definition at line 569 of file xistream.cxx.
References JumpToNextContinue(), mbHasComplRec, mnComplRecSize, mnCurrRecSize, PopPosition(), and PushPosition().
Referenced by CopyRecordToStream(), XclImpFmlaCompImpl::CreateFormula(), XclImpFmlaCompImpl::CreateRangeList(), and GetRecLeft().
|
inline |
|
inline |
Returns the absolute stream position.
Definition at line 459 of file xistream.hxx.
References mrStrm, and SvStream::Tell().
Referenced by ImportExcel::Read(), and ImportExcel8::Read().
|
inline |
Returns the stream size.
Definition at line 461 of file xistream.hxx.
References mnStreamSize.
Referenced by ImportExcel::Read(), and ImportExcel8::Read().
void XclImpStream::Ignore | ( | std::size_t | nBytes | ) |
Seeks forward inside the current record.
Definition at line 798 of file xistream.cxx.
References checkSeek(), GetMaxRawReadSize(), JumpToNextContinue(), mbValid, mnRawRecLeft, mrStrm, and SvStream::Tell().
Referenced by ImportExcel::Array25(), ImportExcel::Array34(), ImportExcel::Bof2(), ImportExcel::Bof3(), ImportExcel::Bof4(), ImportExcel::Columndefault(), ExcelToSc::Convert(), ExcelToSc8::Convert(), ExcScenario::ExcScenario(), ImportExcel8::Feat(), ImportExcel8::FeatHdr(), ImportExcel::Formula25(), ImportExcel::Formula4(), ExcelToSc8::GetAbsRefs(), IgnoreRawUniString(), IgnoreUniString(), ImportExcel::Olesize(), ExcelToSc::ReadExtensionArray(), ExcelToSc::ReadExtensionMemArea(), ExcelToSc::ReadExtensionNlr(), ReadUniString(), ImportExcel::Row25(), ImportExcel::Row34(), ImportExcel8::Scenman(), Seek(), and ImportExcel::Shrfmla().
void XclImpStream::IgnoreRawUniString | ( | sal_uInt16 | nChars, |
bool | b16Bit | ||
) |
Ignores nChars characters.
Definition at line 910 of file xistream.cxx.
References GetMaxRawReadSize(), Ignore(), IsValid(), JumpToNextStringContinue(), and mnRawRecLeft.
Referenced by IgnoreUniString().
void XclImpStream::IgnoreUniString | ( | sal_uInt16 | nChars | ) |
Ignores 8 bit flags, ext.
header, nChar characters, ext. data.
Definition at line 944 of file xistream.cxx.
References IgnoreUniString(), and ReaduInt8().
void XclImpStream::IgnoreUniString | ( | sal_uInt16 | nChars, |
sal_uInt8 | nFlags | ||
) |
Ignores ext.
header, nChar characters, ext. data.
Definition at line 936 of file xistream.cxx.
References Ignore(), IgnoreRawUniString(), and ReadUniStringExtHeader().
Referenced by ExcelToSc8::Convert(), ExcelToSc8::GetAbsRefs(), and IgnoreUniString().
|
private |
Returns true, if the passed ID is real or alternative continuation record ID.
Definition at line 1017 of file xistream.cxx.
References EXC_ID_CONT, and mnAltContId.
Referenced by JumpToNextContinue(), and StartNextRecord().
|
inline |
Returns record reading state: false = record overread.
Definition at line 351 of file xistream.hxx.
References mbValid.
Referenced by ExcelToSc::Convert(), ExcelToSc8::Convert(), ExcelToSc8::GetAbsRefs(), IgnoreRawUniString(), ImportExcel::Read(), ImportExcel8::Read(), and ReadRawUniString().
|
private |
Goes to start of the next CONTINUE record.
@descr Stream must be located at the end of a raw record, and handling of CONTINUE records must be enabled.
Definition at line 1022 of file xistream.cxx.
References IsContinueId(), mbCont, mbValid, mnRawRecId, ReadNextRawRecHeader(), and SetupRawRecord().
Referenced by EnsureRawReadSize(), GetNextRecId(), GetRecSize(), Ignore(), JumpToNextStringContinue(), and Read().
|
private |
Goes to start of the next CONTINUE record while reading strings.
@descr Stream must be located at the end of a raw record. If reading has been started in a CONTINUE record, jumps to an existing following CONTINUE record, even if handling of CONTINUE records is disabled (This is a special handling for TXO string data). Reads additional Unicode flag byte at start of the new raw record and sets or resets rb16Bit.
Definition at line 1030 of file xistream.cxx.
References EXC_ID_CONT, EXC_STRF_16BIT, get_flag(), GetRecLeft(), JumpToNextContinue(), mbCont, mbValid, mbValidRec, mnRawRecId, mnRawRecLeft, mnRawRecSize, mnRecId, ReadNextRawRecHeader(), ReaduInt8(), and SetupRecord().
Referenced by IgnoreRawUniString(), and ReadRawUniString().
sal_uInt16 XclImpStream::PeekRecId | ( | std::size_t | nPos | ) |
Definition at line 604 of file xistream.cxx.
References EXC_ID_UNKNOWN, mbValidRec, mnStreamSize, mrStrm, nPos, SvStream::ReadUInt16(), SvStream::Seek(), and SvStream::Tell().
void XclImpStream::PopPosition | ( | ) |
Seeks to last position from user position stack.
@descr This position will be removed from the stack.
Definition at line 533 of file xistream.cxx.
References maPosStack, and RestorePosition().
Referenced by CopyRecordToStream(), GetNextRecId(), and GetRecSize().
void XclImpStream::PushPosition | ( | ) |
Pushes current position on user position stack.
@descr This stack is emptied when starting a new record with StartNextRecord(). The decryption state (enabled/disabled) is not pushed onto the stack.
Definition at line 527 of file xistream.cxx.
References maPosStack, and StorePosition().
Referenced by CopyRecordToStream(), GetNextRecId(), and GetRecSize().
std::size_t XclImpStream::Read | ( | void * | pData, |
std::size_t | nBytes | ||
) |
Reads nBytes bytes to the existing(!) buffer pData.
Definition at line 721 of file xistream.cxx.
References GetMaxRawReadSize(), JumpToNextContinue(), mbValid, pData, and ReadRawData().
Referenced by CopyToStream(), and ImportExcel8::Feat().
OUString XclImpStream::ReadByteString | ( | bool | b16BitLen | ) |
Reads 8/16 bit string length, character array and returns the string.
Definition at line 959 of file xistream.cxx.
References ReadRawByteString(), ReaduInt16(), and ReaduInt8().
Referenced by ImportExcel::Boundsheet(), ImportExcel::Externname25(), and ImportExcel::Externsheet().
double XclImpStream::ReadDouble | ( | ) |
Definition at line 703 of file xistream.cxx.
References EnsureRawReadSize(), mbUseDecr, mnRawRecLeft, mrStrm, mxDecrypter, nValue, and SvStream::ReadDouble().
Referenced by ExcelToSc::Convert(), ExcelToSc8::Convert(), ImportExcel8::Delta(), ImportExcel::Formula25(), ImportExcel::Formula4(), ExcelToSc::ReadExtensionArray(), and ImportExcel::ReadNumber().
sal_Int16 XclImpStream::ReadInt16 | ( | ) |
Definition at line 631 of file xistream.cxx.
References EnsureRawReadSize(), mbUseDecr, mnRawRecLeft, mrStrm, mxDecrypter, nValue, and SvStream::ReadInt16().
Referenced by ExcelToSc::Convert().
sal_Int32 XclImpStream::ReadInt32 | ( | ) |
Definition at line 667 of file xistream.cxx.
References EnsureRawReadSize(), mbUseDecr, mnRawRecLeft, mrStrm, mxDecrypter, nValue, and SvStream::ReadInt32().
Referenced by ImportExcel::Mulrk(), and ImportExcel::ReadRk().
|
private |
Seeks to next raw record header and reads record ID and size.
@descr This is a "raw" function, means that stream members are inconsistent after return. Does only change mnRawRecId, mnRawRecSize, and the base stream position, but no other members.
Definition at line 977 of file xistream.cxx.
References checkSeek(), SvStream::good(), mnNextRecPos, mnRawRecId, mnRawRecSize, mnStreamSize, mrStrm, and SvStream::ReadUInt16().
Referenced by JumpToNextContinue(), JumpToNextStringContinue(), and StartNextRecord().
OUString XclImpStream::ReadRawByteString | ( | sal_uInt16 | nChars | ) |
Reads nChar byte characters and returns the string.
Definition at line 949 of file xistream.cxx.
References GetMaxRawReadSize(), XclRoot::GetTextEncoding(), mrRoot, and ReadRawData().
Referenced by ExcelToSc::Convert(), ReadByteString(), and ExcelToSc::ReadExtensionArray().
|
private |
Reads and decrypts nBytes bytes to the existing(!) buffer pData.
Definition at line 1072 of file xistream.cxx.
References mbUseDecr, mnRawRecLeft, mrStrm, mxDecrypter, pData, and SvStream::ReadBytes().
Referenced by Read(), and ReadRawByteString().
OUString XclImpStream::ReadRawUniString | ( | sal_uInt16 | nChars, |
bool | b16Bit | ||
) |
Reads nChars characters and returns the string.
Definition at line 837 of file xistream.cxx.
References EXC_NUL, EXC_NUL_C, GetMaxRawReadSize(), IsValid(), JumpToNextStringContinue(), mcNulSubst, mnRawRecLeft, ReaduInt16(), and ReaduInt8().
Referenced by ReadUniString().
sal_uInt16 XclImpStream::ReaduInt16 | ( | ) |
Definition at line 649 of file xistream.cxx.
References EnsureRawReadSize(), mbUseDecr, mnRawRecLeft, mrStrm, mxDecrypter, nValue, and SvStream::ReadUInt16().
Referenced by ImportExcel::Array25(), ImportExcel::Array34(), ImportExcel::Bof2(), ImportExcel::Bof3(), ImportExcel::Bof4(), ImportExcel::Bof5(), ImportExcel8::Boundsheet(), ImportExcel::Boundsheet(), ImportExcel8::Calccount(), ImportExcel::Cellmerging(), ImportExcel::Codepage(), ImportExcel::Colinfo(), ImportExcel::Columndefault(), ImportExcel::Colwidth(), ExcelToSc::Convert(), ExcelToSc8::Convert(), ImportExcel::Country(), ImportExcel::DefColWidth(), ImportExcel::Defrowheight2(), ImportExcel::Defrowheight345(), ExcScenario::ExcScenario(), ImportExcel::Externname25(), ImportExcel8::Feat(), ImportExcel8::FeatHdr(), ImportExcel::Formula25(), ImportExcel::Formula4(), ExcelToSc8::GetAbsRefs(), ImportExcel::Hideobj(), ImportExcel8::Iteration(), ImportExcel::Ixfe(), ImportExcel8::Labelsst(), ImportExcel::Mulblank(), ImportExcel::Mulrk(), ImportExcel8::Precision(), ReadByteString(), ImportExcel::ReadDimensions(), ExcelToSc::ReadExtensionArray(), ExcelToSc::ReadExtensionMemArea(), ImportExcel::ReadFileSharing(), ImportExcel::ReadInteger(), XclImpPivotCache::ReadPivotCacheStream(), ReadRawUniString(), ReadUniString(), ReadUniStringExtHeader(), ImportExcel::ReadUsesElfs(), ImportExcel::ReadXFIndex(), ImportExcel::Rec1904(), ImportExcel::Row25(), ImportExcel::Row34(), ImportExcel::Rstring(), ImportExcel8::Scenman(), ImportExcel::Shrfmla(), ImportExcel::Standardwidth(), ImportExcel::TableOp(), and ImportExcel::Wsbool().
sal_uInt32 XclImpStream::ReaduInt32 | ( | ) |
Definition at line 685 of file xistream.cxx.
References EnsureRawReadSize(), mbUseDecr, mnRawRecLeft, mrStrm, mxDecrypter, nValue, and SvStream::ReadUInt32().
Referenced by ImportExcel8::Boundsheet(), ImportExcel::Boundsheet(), ImportExcel::Externname25(), ImportExcel8::Feat(), ImportExcel8::Labelsst(), ImportExcel::ReadDimensions(), ExcelToSc::ReadExtensionNlr(), and ReadUniStringExtHeader().
sal_uInt8 XclImpStream::ReaduInt8 | ( | ) |
Definition at line 617 of file xistream.cxx.
References EnsureRawReadSize(), mbUseDecr, mnRawRecLeft, mrStrm, mxDecrypter, nValue, and SvStream::ReadUChar().
Referenced by ImportExcel::Array25(), ImportExcel::Array34(), ImportExcel8::Boundsheet(), ImportExcel::Columndefault(), ImportExcel::Colwidth(), ExcelToSc::Convert(), ExcelToSc8::Convert(), ExcScenario::ExcScenario(), ImportExcel::Formula25(), ExcelToSc8::GetAbsRefs(), IgnoreUniString(), JumpToNextStringContinue(), ImportExcel::ReadBoolErr(), ReadByteString(), ExcelToSc::ReadExtensionArray(), XclImpPivotCache::ReadPivotCacheStream(), ReadRawUniString(), ReadUniString(), ImportExcel::ReadXFIndex(), and ImportExcel::TableOp().
OUString XclImpStream::ReadUniString | ( | ) |
Reads 16 bit character count, 8 bit flags, ext.
header, character array, ext. data and returns the string.
Definition at line 905 of file xistream.cxx.
References ReaduInt16(), and ReadUniString().
Referenced by ReadUniString().
OUString XclImpStream::ReadUniString | ( | sal_uInt16 | nChars | ) |
Reads 8 bit flags, ext.
header, nChar characters, ext. data and returns the string.
Definition at line 900 of file xistream.cxx.
References ReaduInt8(), and ReadUniString().
OUString XclImpStream::ReadUniString | ( | sal_uInt16 | nChars, |
sal_uInt8 | nFlags | ||
) |
Reads ext.
header, nChar characters, ext. data and returns the string.
Definition at line 891 of file xistream.cxx.
References Ignore(), ReadRawUniString(), and ReadUniStringExtHeader().
Referenced by ImportExcel8::Boundsheet(), ExcelToSc8::Convert(), ExcScenario::ExcScenario(), ImportExcel8::Feat(), and ExcelToSc::ReadExtensionArray().
std::size_t XclImpStream::ReadUniStringExtHeader | ( | bool & | rb16Bit, |
bool & | rbRich, | ||
bool & | rbFareast, | ||
sal_uInt16 & | rnFormatRuns, | ||
sal_uInt32 & | rnExtInf, | ||
sal_uInt8 | nFlags | ||
) |
Reads ext.
header, detects 8/16 bit mode, sets all ext. info.
Definition at line 816 of file xistream.cxx.
References EXC_STRF_16BIT, EXC_STRF_FAREAST, EXC_STRF_RICH, EXC_STRF_UNKNOWN, get_flag(), ReaduInt16(), and ReaduInt32().
Referenced by IgnoreUniString(), ReadUniString(), and ReadUniStringExtHeader().
std::size_t XclImpStream::ReadUniStringExtHeader | ( | bool & | rb16Bit, |
sal_uInt8 | nFlags | ||
) |
Seeks to begin of character array, detects 8/16 bit mode.
Definition at line 829 of file xistream.cxx.
References ReadUniStringExtHeader().
void XclImpStream::ResetRecord | ( | bool | bContLookup, |
sal_uInt16 | nAltContId = EXC_ID_UNKNOWN |
||
) |
Sets stream pointer to begin of record content.
bContLookup | Automatic CONTINUE lookup on/off. In difference to other stream settings, this setting is persistent until next call of this function (because it is wanted to receive the next CONTINUE records separately). |
nAltContId | Sets an alternative record ID for content continuation. This value is reset automatically when a new record is started with StartNextRecord(). |
Definition at line 487 of file xistream.cxx.
References EnableDecryption(), maFirstRec, maPosStack, mbCont, mbHasComplRec, mbValidRec, mnAltContId, mnComplRecSize, mnCurrRecSize, mnRawRecSize, and RestorePosition().
void XclImpStream::RestorePosition | ( | const XclImpStreamPos & | rPos | ) |
Restores stream position contained in rPos.
Definition at line 971 of file xistream.cxx.
References XclImpStreamPos::Get(), mbValid, mnCurrRecSize, mnNextRecPos, mnRawRecId, mnRawRecLeft, mnRawRecSize, mrStrm, and SetupDecrypter().
Referenced by CopyRecordToStream(), PopPosition(), ResetRecord(), Seek(), and SeekGlobalPosition().
void XclImpStream::RewindRecord | ( | ) |
Sets stream pointer before current record and invalidates stream.
@descr The next call to StartNextRecord() will start again the current record. This can be used in situations where a loop or a function leaves on a specific record, but the parent context expects to start this record by itself. The stream is invalid as long as the first record has not been started (it is not allowed to call any other stream operation then).
Definition at line 501 of file xistream.cxx.
References XclImpStreamPos::GetPos(), maFirstRec, mbValid, mbValidRec, and mnNextRecPos.
void XclImpStream::Seek | ( | std::size_t | nPos | ) |
Seeks absolute in record content to the specified position.
@descr The value 0 means start of record, independent from physical stream position.
Definition at line 781 of file xistream.cxx.
References GetRecPos(), Ignore(), maFirstRec, mbValid, mbValidRec, nPos, and RestorePosition().
Referenced by ExcelToSc::Convert(), ExcelToSc8::Convert(), and ExcelToSc8::GetAbsRefs().
void XclImpStream::SeekGlobalPosition | ( | ) |
Seeks to the stored global user position.
Definition at line 551 of file xistream.cxx.
References maGlobPos, mbCont, mbGlobValidRec, mbHasComplRec, mbHasGlobPos, mbValidRec, mnComplRecSize, mnCurrRecSize, mnGlobRecId, mnRecId, and RestorePosition().
Referenced by ImportExcel::Read(), and ImportExcel8::Read().
void XclImpStream::SetDecrypter | ( | XclImpDecrypterRef const & | xDecrypter | ) |
Enables decryption of record contents for the rest of the stream.
Definition at line 507 of file xistream.cxx.
References EnableDecryption(), mxDecrypter, and SetupDecrypter().
Referenced by CopyDecrypterFrom().
|
inline |
Sets a replacement character for NUL characters.
@descr NUL characters must be replaced, because Tools strings cannot handle them. The substitution character is reset to '?' automatically, if a new record is started using the function StartNextRecord().
cNulSubst | The character to use for NUL replacement. It is possible to specify NUL here. in this case strings are terminated when the first NUL occurs during string import. |
Definition at line 430 of file xistream.hxx.
References mcNulSubst.
Referenced by SetupRecord().
|
inline |
Set an SVSTREAM_..._ERROR.
Definition at line 469 of file xistream.hxx.
References mrStrm, and SvStream::SetError().
|
private |
Initializes the decrypter to read a new record.
Definition at line 988 of file xistream.cxx.
References mnRawRecSize, mrStrm, and mxDecrypter.
Referenced by RestorePosition(), SetDecrypter(), and SetupRawRecord().
|
private |
Initializes all members after base stream has been sought to new raw record.
Definition at line 994 of file xistream.cxx.
References mnCurrRecSize, mnNextRecPos, mnRawRecLeft, mnRawRecSize, mrStrm, SetupDecrypter(), and SvStream::Tell().
Referenced by JumpToNextContinue(), and SetupRecord().
|
private |
Initializes all members after base stream has been sought to new record.
Definition at line 1004 of file xistream.cxx.
References EnableDecryption(), EXC_ID_UNKNOWN, maFirstRec, mbCont, mbHasComplRec, mnAltContId, mnComplRecSize, mnCurrRecSize, mnRawRecId, mnRawRecSize, mnRecId, SetNulSubstChar(), SetupRawRecord(), and StorePosition().
Referenced by JumpToNextStringContinue(), and StartNextRecord().
bool XclImpStream::StartNextRecord | ( | ) |
Sets stream pointer to the start of the next record content.
@descr Ignores all CONTINUE records of the current record, if automatic CONTINUE usage is switched on.
Definition at line 456 of file xistream.cxx.
References IsContinueId(), maPosStack, mbCont, mbValid, mbValidRec, mnNextRecPos, mnRawRecId, mnRawRecSize, mrStrm, ReadNextRawRecHeader(), SetupRecord(), and SvStream::Tell().
Referenced by XclImpFmlaCompImpl::CreateFormula(), XclImpFmlaCompImpl::CreateRangeList(), ImportExcel::Read(), ImportExcel8::Read(), XclImpChangeTrack::ReadFormula(), XclImpDffConverter::ReadHlinkProperty(), XclImpPivotCache::ReadPivotCacheStream(), and StartNextRecord().
bool XclImpStream::StartNextRecord | ( | std::size_t | nNextRecPos | ) |
Sets stream pointer to the start of the record content for the record at the passed absolute stream position.
Definition at line 481 of file xistream.cxx.
References mnNextRecPos, and StartNextRecord().
void XclImpStream::StoreGlobalPosition | ( | ) |
Stores current position.
This position keeps valid in all records.
Definition at line 543 of file xistream.cxx.
References maGlobPos, mbGlobValidRec, mbHasGlobPos, mbValidRec, mnGlobRecId, mnRecId, and StorePosition().
Referenced by ImportExcel::Read(), and ImportExcel8::Read().
void XclImpStream::StorePosition | ( | XclImpStreamPos & | rPos | ) |
Stores current stream position into rPos.
Definition at line 966 of file xistream.cxx.
References mbValid, mnCurrRecSize, mnNextRecPos, mnRawRecId, mnRawRecLeft, mnRawRecSize, mrStrm, and XclImpStreamPos::Set().
Referenced by PushPosition(), SetupRecord(), and StoreGlobalPosition().
|
private |
Provides methods to decrypt data.
Definition at line 522 of file xistream.hxx.
Referenced by CopyRecordToStream(), ResetRecord(), RewindRecord(), Seek(), and SetupRecord().
|
private |
Stack for record positions.
Definition at line 526 of file xistream.hxx.
Referenced by SeekGlobalPosition(), and StoreGlobalPosition().
|
private |
Start position of current record.
Definition at line 524 of file xistream.hxx.
Referenced by PopPosition(), PushPosition(), ResetRecord(), and StartNextRecord().
|
private |
Replacement for NUL characters.
Definition at line 546 of file xistream.hxx.
Referenced by JumpToNextContinue(), JumpToNextStringContinue(), ResetRecord(), SeekGlobalPosition(), SetupRecord(), and StartNextRecord().
|
private |
Record ID for user defined position.
Definition at line 528 of file xistream.hxx.
Referenced by SeekGlobalPosition(), and StoreGlobalPosition().
|
private |
Size of complete record data (with CONTINUEs).
Definition at line 535 of file xistream.hxx.
Referenced by GetRecSize(), ResetRecord(), SeekGlobalPosition(), and SetupRecord().
|
private |
Was user position a valid record?
Definition at line 529 of file xistream.hxx.
Referenced by SeekGlobalPosition(), and StoreGlobalPosition().
|
private |
Automatic CONTINUE lookup on/off.
Definition at line 547 of file xistream.hxx.
Referenced by EnableDecryption(), ReadDouble(), ReadInt16(), ReadInt32(), ReadRawData(), ReaduInt16(), ReaduInt32(), and ReaduInt8().
|
private |
false = No more records to read.
Definition at line 549 of file xistream.hxx.
Referenced by CopyToStream(), EnsureRawReadSize(), GetRecLeft(), GetRecPos(), Ignore(), IsValid(), JumpToNextContinue(), JumpToNextStringContinue(), Read(), RestorePosition(), RewindRecord(), Seek(), StartNextRecord(), and StorePosition().
|
private |
Usage of decryption.
Definition at line 548 of file xistream.hxx.
Referenced by CopyRecordToStream(), GetNextRecId(), JumpToNextStringContinue(), PeekRecId(), ResetRecord(), RewindRecord(), Seek(), SeekGlobalPosition(), StartNextRecord(), and StoreGlobalPosition().
|
private |
Bytes left in current raw record (without following CONTINUEs).
Definition at line 544 of file xistream.hxx.
Referenced by ReadRawUniString(), and SetNulSubstChar().
|
private |
Current record ID (not the CONTINUE ID).
Definition at line 538 of file xistream.hxx.
Referenced by IsContinueId(), ResetRecord(), and SetupRecord().
|
private |
Helper for record position.
Definition at line 534 of file xistream.hxx.
Referenced by GetRecSize(), ResetRecord(), SeekGlobalPosition(), and SetupRecord().
|
private |
Start of next record header.
Definition at line 533 of file xistream.hxx.
Referenced by GetRecPos(), GetRecSize(), ResetRecord(), RestorePosition(), SeekGlobalPosition(), SetupRawRecord(), SetupRecord(), and StorePosition().
|
private |
User defined position elsewhere in stream.
Definition at line 527 of file xistream.hxx.
Referenced by SeekGlobalPosition(), and StoreGlobalPosition().
|
private |
Size of system stream.
Definition at line 532 of file xistream.hxx.
Referenced by GetNextRecId(), ReadNextRawRecHeader(), RestorePosition(), RewindRecord(), SetupRawRecord(), StartNextRecord(), and StorePosition().
|
private |
Alternative record ID for content continuation.
Definition at line 540 of file xistream.hxx.
Referenced by JumpToNextContinue(), JumpToNextStringContinue(), ReadNextRawRecHeader(), RestorePosition(), SetupRecord(), StartNextRecord(), and StorePosition().
|
private |
Current raw record size (without following CONTINUEs).
Definition at line 542 of file xistream.hxx.
Referenced by EnsureRawReadSize(), GetMaxRawReadSize(), GetRecPos(), Ignore(), IgnoreRawUniString(), JumpToNextStringContinue(), ReadDouble(), ReadInt16(), ReadInt32(), ReadRawData(), ReadRawUniString(), ReaduInt16(), ReaduInt32(), ReaduInt8(), RestorePosition(), SetupRawRecord(), and StorePosition().
|
private |
Current raw record ID (including CONTINUEs).
Definition at line 541 of file xistream.hxx.
Referenced by JumpToNextStringContinue(), ReadNextRawRecHeader(), ResetRecord(), RestorePosition(), SetupDecrypter(), SetupRawRecord(), SetupRecord(), StartNextRecord(), and StorePosition().
|
private |
true = mnComplRecSize is valid.
Definition at line 537 of file xistream.hxx.
Referenced by GetRecId(), JumpToNextStringContinue(), SeekGlobalPosition(), SetupRecord(), and StoreGlobalPosition().
|
private |
Is user position defined?
Definition at line 531 of file xistream.hxx.
Referenced by GetNextRecId(), GetSvStreamSize(), PeekRecId(), ReadNextRawRecHeader(), and XclImpStream().
|
private |
Reference to the system input stream.
Definition at line 518 of file xistream.hxx.
Referenced by GetRoot(), and ReadRawByteString().
|
private |
Definition at line 517 of file xistream.hxx.
Referenced by GetNextRecId(), GetSvStreamPos(), Ignore(), PeekRecId(), ReadDouble(), ReadInt16(), ReadInt32(), ReadNextRawRecHeader(), ReadRawData(), ReaduInt16(), ReaduInt32(), ReaduInt8(), RestorePosition(), SetSvStreamError(), SetupDecrypter(), SetupRawRecord(), StartNextRecord(), StorePosition(), and XclImpStream().
|
private |
Filter root data.
Definition at line 520 of file xistream.hxx.
Referenced by EnableDecryption(), ReadDouble(), ReadInt16(), ReadInt32(), ReadRawData(), ReaduInt16(), ReaduInt32(), ReaduInt8(), SetDecrypter(), and SetupDecrypter().