template<typename T> class SVT_DLLPUBLIC SvParser : public SvRefBase
{
DECL_DLLPRIVATE_LINK( NewDataRead, LinkParamNone*, void );
protected:
SvStream& rInput;
OUStringBuffer aToken; // scanned token
sal_uInt32 nlLineNr; // current line number
sal_uInt32 nlLinePos; // current column number
sal_uInt32 nConversionErrors; // count of conversion errors
std::unique_ptr<SvParser_Impl<T>> pImplData; // internal data
tools::Long m_nTokenIndex; // current token index to detect loops for seeking backwards
tools::Long nTokenValue; // additional value (RTF) bool bTokenHasValue; // indicates whether nTokenValue is valid bool bFuzzing; // indicates we are in Fuzzing mode
SvParserState eState; // status also in derived classes
rtl_TextEncoding eSrcEnc; // Source encoding
sal_uInt64 nNextChPos;
sal_uInt32 nNextCh; // current character codepoint in UTF32 for the "lex"
bool bSwitchToUCS2 : 1; // switching is allowed bool bRTF_InTextRead : 1; // only for RTF-Parser!!!
// methods for Token stack
T SkipToken( short nCnt = -1 ); // "skip" n Tokens back
TokenStackType* GetStackPtr( short nCnt );
// scan the next token: // work off Token stack and call GetNextToken_() if necessary. // That one is responsible for the recognition of new Tokens.
T GetNextToken(); virtual T GetNextToken_() = 0;
// is called for each Token that is recognized in CallParser virtualvoid NextToken( T nToken ) = 0;
// at times of SvRefBase derivation, not everybody may delete virtual ~SvParser() override;
// for asynchronous reading from the SvStream void SaveState( T nToken ); void RestoreState(); virtualvoidContinue( T nToken );
// Set/get source encoding. The UCS2BEncoding flag is valid if source // encoding is UCS2. It specifies a big endian encoding. void SetSrcEncoding( rtl_TextEncoding eSrcEnc );
rtl_TextEncoding GetSrcEncoding() const;
// May the character set be switched to UCS/2, if a BOM // is in the first two characters of the stream? void SetSwitchToUCS2( bool bSet ); bool IsSwitchToUCS2() const;
// how many bytes a character consists of
sal_uInt16 GetCharSize() const;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.