CParserContext.h (1699B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6 /** 7 * MODULE NOTES: 8 * @update gess 4/1/98 9 * 10 */ 11 12 #ifndef __CParserContext 13 #define __CParserContext 14 15 #include "nsIParser.h" 16 #include "nsIRequest.h" 17 #include "nsScanner.h" 18 #include "nsString.h" 19 #include "nsCOMPtr.h" 20 21 class nsITokenizer; 22 23 /** 24 * Note that the parser is given FULL access to all 25 * data in a parsercontext. Hey, that what it's for! 26 */ 27 28 /** 29 * Legacy enum kept around for now to accommodate fragment vs. not fragment 30 * paths in nsParser. 31 */ 32 enum eAutoDetectResult { 33 eUnknownDetect, 34 ePrimaryDetect, 35 }; 36 37 /** 38 * Legacy enum kept around for now to accommodate fragment vs. not fragment 39 * paths in nsParser. 40 */ 41 enum nsDTDMode { eDTDMode_full_standards, eDTDMode_autodetect }; 42 43 class CParserContext { 44 public: 45 CParserContext(nsIURI* aURI, eParserCommands aCommand); 46 CParserContext(const nsAString& aBuffer, eParserCommands aCommand, 47 bool aLastBuffer); 48 49 ~CParserContext(); 50 51 void SetMimeType(const nsACString& aMimeType); 52 53 nsCOMPtr<nsIRequest> 54 mRequest; // provided by necko to differnciate different input streams 55 // why is mRequest strongly referenced? see bug 102376. 56 nsScanner mScanner; 57 58 nsCString mMimeType; 59 nsDTDMode mDTDMode; 60 61 eParserDocType mDocType; 62 eStreamState mStreamListenerState; 63 eAutoDetectResult mAutoDetectStatus = eUnknownDetect; 64 eParserCommands mParserCommand; 65 66 bool mMultipart; 67 bool mCopyUnused; 68 }; 69 70 #endif