зеркало из https://github.com/mozilla/gecko-dev.git
Part of fix for bug 192139 (Integrate latest Expat). Some cleanup in nsExpatDriver.cpp/.h. r=Pike, sr=jst.
This commit is contained in:
Родитель
3f2e78bb29
Коммит
9e04c631ee
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -39,6 +39,7 @@
|
||||||
#define NS_EXPAT_DRIVER__
|
#define NS_EXPAT_DRIVER__
|
||||||
|
|
||||||
#include "xmlparse.h"
|
#include "xmlparse.h"
|
||||||
|
#include "nsCOMPtr.h"
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
#include "nsIDTD.h"
|
#include "nsIDTD.h"
|
||||||
#include "nsITokenizer.h"
|
#include "nsITokenizer.h"
|
||||||
|
@ -58,15 +59,16 @@ public:
|
||||||
nsExpatDriver();
|
nsExpatDriver();
|
||||||
virtual ~nsExpatDriver();
|
virtual ~nsExpatDriver();
|
||||||
|
|
||||||
int HandleExternalEntityRef(const PRUnichar *openEntityNames,
|
int HandleExternalEntityRef(const PRUnichar *aOpenEntityNames,
|
||||||
const PRUnichar *base,
|
const PRUnichar *aBase,
|
||||||
const PRUnichar *systemId,
|
const PRUnichar *aSystemId,
|
||||||
const PRUnichar *publicId);
|
const PRUnichar *aPublicId);
|
||||||
nsresult HandleStartElement(const PRUnichar *aName, const PRUnichar **aAtts);
|
nsresult HandleStartElement(const PRUnichar *aName, const PRUnichar **aAtts);
|
||||||
nsresult HandleEndElement(const PRUnichar *aName);
|
nsresult HandleEndElement(const PRUnichar *aName);
|
||||||
nsresult HandleCharacterData(const PRUnichar *aCData, const PRUint32 aLength);
|
nsresult HandleCharacterData(const PRUnichar *aCData, const PRUint32 aLength);
|
||||||
nsresult HandleComment(const PRUnichar *aName);
|
nsresult HandleComment(const PRUnichar *aName);
|
||||||
nsresult HandleProcessingInstruction(const PRUnichar *aTarget, const PRUnichar *aData);
|
nsresult HandleProcessingInstruction(const PRUnichar *aTarget,
|
||||||
|
const PRUnichar *aData);
|
||||||
nsresult HandleXMLDeclaration(const PRUnichar *aData, const PRUint32 aLength);
|
nsresult HandleXMLDeclaration(const PRUnichar *aData, const PRUint32 aLength);
|
||||||
nsresult HandleDefault(const PRUnichar *aData, const PRUint32 aLength);
|
nsresult HandleDefault(const PRUnichar *aData, const PRUint32 aLength);
|
||||||
nsresult HandleStartCdataSection();
|
nsresult HandleStartCdataSection();
|
||||||
|
@ -74,20 +76,20 @@ public:
|
||||||
nsresult HandleStartDoctypeDecl();
|
nsresult HandleStartDoctypeDecl();
|
||||||
nsresult HandleEndDoctypeDecl();
|
nsresult HandleEndDoctypeDecl();
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
|
|
||||||
// Load up an external stream to get external entity information
|
// Load up an external stream to get external entity information
|
||||||
nsresult OpenInputStreamFromExternalDTD(const PRUnichar* aFPIStr,
|
nsresult OpenInputStreamFromExternalDTD(const PRUnichar* aFPIStr,
|
||||||
const PRUnichar* aURLStr,
|
const PRUnichar* aURLStr,
|
||||||
const PRUnichar* aBaseURL,
|
const PRUnichar* aBaseURL,
|
||||||
nsIInputStream** in,
|
nsIInputStream** aStream,
|
||||||
nsAString& aAbsURL);
|
nsAString& aAbsURL);
|
||||||
|
|
||||||
nsresult ParseBuffer(const char* aBuffer, PRUint32 aLength, PRBool aIsFinal);
|
nsresult ParseBuffer(const char* aBuffer, PRUint32 aLength, PRBool aIsFinal);
|
||||||
nsresult HandleError(const char *aBuffer, PRUint32 aLength, PRBool aIsFinal);
|
nsresult HandleError(const char *aBuffer, PRUint32 aLength, PRBool aIsFinal);
|
||||||
void GetLine(const char* aSourceBuffer, PRUint32 aLength, PRUint32 aOffset, nsString& aLine);
|
void GetLine(const char* aSourceBuffer, PRUint32 aLength, PRUint32 aOffset,
|
||||||
|
nsString& aLine);
|
||||||
|
|
||||||
XML_Parser mExpatParser;
|
XML_Parser mExpatParser;
|
||||||
nsString mLastLine;
|
nsString mLastLine;
|
||||||
nsString mCDataText;
|
nsString mCDataText;
|
||||||
nsString mDoctypeText;
|
nsString mDoctypeText;
|
||||||
|
@ -98,10 +100,10 @@ protected:
|
||||||
PRInt32 mBytePosition;
|
PRInt32 mBytePosition;
|
||||||
nsresult mInternalState;
|
nsresult mInternalState;
|
||||||
PRUint32 mBytesParsed;
|
PRUint32 mBytesParsed;
|
||||||
nsIExpatSink* mSink;
|
nsCOMPtr<nsIExpatSink> mSink;
|
||||||
const nsCatalogData* mCatalogData; // weak
|
const nsCatalogData* mCatalogData; // weak
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
nsresult NS_NewExpatDriver(nsIDTD** aDriver);
|
nsresult NS_NewExpatDriver(nsIDTD** aDriver);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Загрузка…
Ссылка в новой задаче