www.pudn.com > TidyWin32-src.zip > Config.h


#ifndef CONFIG_H 
#define CONFIG_H 
 
//------------------------------------------------------------------- 
class CConfig { 
public:		// constructor 
	CConfig() { Reset(); } 
 
public:		// enum types 
	// Character encodings 
	enum CharEncoding { 
		Enc_Raw, Enc_ASCII, Enc_Latin1, Enc_UTF8, Enc_ISO2022, Enc_MacRoman 
	}; 
	// Used by Set/Getindent() 
	enum IndentScheme { 
		NoIndent, 
		IndentBlocks, 
		AutoIndent 
	}; 
 
public:	// functions 
	void Reset(); 
 
public:	// accessors 
	// Markup 
	string GetDoctype() const { return m_Doctype; } 
	void SetDoctype(string v) { m_Doctype = v; } 
	bool GetTidyMark() const { return m_TidyMark; } 
	void SetTidyMark(bool v) { m_TidyMark = v; } 
	bool GetHideEndtags() const { return m_HideEndtags; } 
	void SetHideEndtags(bool v) { m_HideEndtags = v; } 
	bool GetEncloseText() const { return m_EncloseText; } 
	void SetEncloseText(bool v) { m_EncloseText = v; } 
	bool GetEncloseBlockText() const { return m_EncloseBlockText; } 
	void SetEncloseBlockText(bool v) { m_EncloseBlockText = v; } 
	string GetNewEmptyTags() const { return m_NewEmptyTags; } 
	void SetNewEmptyTags(string v) { m_NewEmptyTags = v; } 
	string GetNewInlineTags() const { return m_NewInlineTags; } 
	void SetNewInlineTags(string v) { m_NewInlineTags = v; } 
	string GetNewBlocklevelTags() const { return m_NewBlocklevelTags; } 
	void SetNewBlocklevelTags(string v) { m_NewBlocklevelTags = v; } 
	string GetNewPreTags() const { return m_NewPreTags; } 
	void SetNewPreTags(string v) { m_NewPreTags = v; } 
 
	// Cleanup 
	bool GetClean() const { return m_Clean; } 
	void SetClean(bool v) { m_Clean = v; } 
	bool GetDropFontTags() const { return m_DropFontTags; } 
	void SetDropFontTags(bool v) { m_DropFontTags = v; } 
	bool GetLogicalEmphasis() const { return m_LogicalEmphasis; } 
	void SetLogicalEmphasis(bool v) { m_LogicalEmphasis = v; } 
	bool GetDropEmptyParas() const { return m_DropEmptyParas; } 
	void SetDropEmptyParas(bool v) { m_DropEmptyParas = v; } 
	bool GetWord2000() const { return m_Word2000; } 
	void SetWord2000(bool v) { m_Word2000 = v; } 
	bool GetFixBadComments() const { return m_FixBadComments; } 
	void SetFixBadComments(bool v) { m_FixBadComments = v; } 
	bool GetFixBackslash() const { return m_FixBackslash; } 
	void SetFixBackslash(bool v) { m_FixBackslash = v; } 
	string GetAltText() const { return m_AltText; } 
	void SetAltText(string v) { m_AltText = v; } 
 
	// XML 
	bool GetInputXml() const { return m_InputXml; } 
	void SetInputXml(bool v) { m_InputXml = v; } 
	bool GetOutputXml() const { return m_OutputXml; } 
	void SetOutputXml(bool v) { m_OutputXml = v; } 
	bool GetOutputXhtml() const { return m_OutputXhtml; } 
	void SetOutputXhtml(bool v) { m_OutputXhtml = v; } 
	bool GetAddXmlDecl() const { return m_AddXmlDecl; } 
	void SetAddXmlDecl(bool v) { m_AddXmlDecl = v; } 
	bool GetAssumeXmlProcins() const { return m_AssumeXmlProcins; } 
	void SetAssumeXmlProcins(bool v) { m_AssumeXmlProcins = v; } 
 
	// Encoding 
	CharEncoding GetCharEncoding() const { return m_CharEncoding; } 
	void SetCharEncoding(CharEncoding v) { m_CharEncoding = v; } 
	bool GetNumericEntities() const { return m_NumericEntities; } 
	void SetNumericEntities(bool v) { m_NumericEntities = v; } 
	bool GetQuoteMarks() const { return m_QuoteMarks; } 
	void SetQuoteMarks(bool v) { m_QuoteMarks = v; } 
	bool GetQuoteNbsp() const { return m_QuoteNbsp; } 
	void SetQuoteNbsp(bool v) { m_QuoteNbsp = v; } 
	bool GetQuoteAmpersand() const { return m_QuoteAmpersand; } 
	void SetQuoteAmpersand(bool v) { m_QuoteAmpersand = v; } 
 
	// Layout 
	IndentScheme GetIndent() const { return m_Indent; } 
	void SetIndent(IndentScheme v) { m_Indent = v; } 
	unsigned int GetIndentSpaces() const { return m_IndentSpaces; } 
	void SetIndentSpaces(unsigned int v) { m_IndentSpaces = v; } 
	unsigned int GetWrap() const { return m_Wrap; } 
	void SetWrap(unsigned int v) { m_Wrap = v; } 
	int GetTabSize() const { return m_TabSize; } 
	void SetTabSize(int v) { m_TabSize = v; } 
	bool GetIndentAttributes() const { return m_IndentAttributes; } 
	void SetIndentAttributes(bool v) { m_IndentAttributes = v; } 
	bool GetWrapAttributes() const { return m_WrapAttributes; } 
	void SetWrapAttributes(bool v) { m_WrapAttributes = v; } 
	bool GetWrapScriptLiterals() const { return m_WrapScriptLiterals; } 
	void SetWrapScriptLiterals(bool v) { m_WrapScriptLiterals = v; } 
	bool GetWrapAsp() const { return m_WrapAsp; } 
	void SetWrapAsp(bool v) { m_WrapAsp = v; } 
	bool GetWrapJste() const { return m_WrapJste; } 
	void SetWrapJste(bool v) { m_WrapJste = v; } 
	bool GetWrapPhp() const { return m_WrapPhp; } 
	void SetWrapPhp(bool v) { m_WrapPhp = v; } 
	bool GetBreakBeforeBr() const { return m_BreakBeforeBr; } 
	void SetBreakBeforeBr(bool v) { m_BreakBeforeBr = v; } 
	bool GetUppercaseTags() const { return m_UppercaseTags; } 
	void SetUppercaseTags(bool v) { m_UppercaseTags = v; } 
	bool GetUppercaseAttributes() const { return m_UppercaseAttributes; } 
	void SetUppercaseAttributes(bool v) { m_UppercaseAttributes = v; } 
 
	// Operation 
	bool GetMarkup() const { return m_Markup; } 
	void SetMarkup(bool v) { m_Markup = v; } 
	bool GetQuiet() const { return m_Quiet; } 
	void SetQuiet(bool v) { m_Quiet = v; } 
	bool GetShowWarnings() const { return m_ShowWarnings; } 
	void SetShowWarnings(bool v) { m_ShowWarnings = v; } 
	bool GetSplit() const { return m_Split; } 
	void SetSplit(bool v) { m_Split = v; } 
	bool GetWriteBack() const { return m_WriteBack; } 
	void SetWriteBack(bool v) { m_WriteBack = v; } 
	bool GetKeepTime() const { return m_KeepTime; } 
	void SetKeepTime(bool v) { m_KeepTime = v; } 
	string GetErrorFile() const { return m_ErrorFile; } 
	void SetErrorFile(string v) { m_ErrorFile = v; } 
 
private:	// variables 
	// Markup 
	string m_Doctype;		// Doctype declaration generated by Tidy 
	bool m_TidyMark;		// Add Tidy meta element 
	bool m_HideEndtags;		// Suppress optional end tags 
	bool m_EncloseText;		// Enclose text in BODY whitin 

's bool m_EncloseBlockText; // Enclose text in blocks whitin

's string m_NewEmptyTags; // New empty tags (space or comma separated list) string m_NewInlineTags; // New inline tags (space or comma separated list) string m_NewBlocklevelTags; // New block-level tags (space or comma separated list) string m_NewPreTags; // New

-like tags (space or comma separated list) 
 
	// Cleanup 
	bool m_Clean;			// Replace presentational tags and attrs by style rules 
	bool m_DropFontTags;		// Discard  and 
tags bool m_LogicalEmphasis; // Replace by and by bool m_DropEmptyParas; // Discard empty paragraphs bool m_Word2000; // Source document is from MS Word 2000 bool m_FixBadComments; // Fix bad comments bool m_FixBackslash; // Replace '\' in URLs by '/' string m_AltText; // Default text for ALT attributes // XML bool m_InputXml; // Input is XML bool m_OutputXml; // Output as XML bool m_OutputXhtml; // Output as XHTML bool m_AddXmlDecl; // Add XML declaration bool m_AssumeXmlProcins; // Assume XML processing instructions ('?>' PI terminator) // Encoding CharEncoding m_CharEncoding; // Character encoding bool m_NumericEntities; // Output numeric character entities bool m_QuoteMarks; // Output " characters as " bool m_QuoteNbsp; // Output non-breaking spaces as entities bool m_QuoteAmpersand; // Output unadorned & characters as & // Layout IndentScheme m_Indent; // Indentation unsigned int m_IndentSpaces; // Number of spaces for indentation unsigned int m_Wrap; // Right margin for line wrapping int m_TabSize; // Number of columns between successive tab stops bool m_IndentAttributes; // Indent attributes bool m_WrapAttributes; // Wrap attribute values bool m_WrapScriptLiterals; // Wrap string literals in script attributes bool m_WrapAsp; // Wrap lines in ASP pseudo-elements (<% ... %>) bool m_WrapJste; // Wrap lines in JSTE pseudo-elements (<# ... #>) bool m_WrapPhp; // Wrap lines in PHP processing instructions bool m_BreakBeforeBr; // Break before
bool m_UppercaseTags; // Uppercase tags bool m_UppercaseAttributes; // Uppercase attributes // Operation bool m_Markup; // Suppress tidied document output bool m_Quiet; // Quiet (no 'Parsing X', guessed DTD or error summary) bool m_ShowWarnings; // Show warnings bool m_Split; // Create a sequence of slides bool m_WriteBack; // bool m_KeepTime; // Keep time of source file string m_ErrorFile; // File to write errors and warnings }; //------------------------------------------------------------------- #endif // CONFIG_H