C# 클래스 Majestic12.HTMLchunk

Parsed HTML token that is either text, comment, script, open or closed tag as indicated by the oType variable.
상속: IDisposable
파일 보기 프로젝트 열기: arktronic/sevenauth 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
MAX_PARAMS int
TEXT_CAPACITY int
bClosure bool
bComments bool
bEndClosure bool
bEntities bool
bHashMode bool
bLtEntity bool
cParamChars byte[]
iChunkLength int
iChunkOffset int
iParams int
oEnc Encoding
oHTML string
oParams object>.System.Collections.Generic.Dictionary
oType HTMLchunkType
sParams string[]
sTag string
sValues string[]

공개 메소드들

메소드 설명
AddParam ( string sParam, string sValue, byte cParamChar ) : void

Adds tag parameter to the chunk

Clear ( ) : void

Clears chunk preparing it for

ConvertParamsToHash ( ) : void

This function will convert parameters stored in sParams/sValues arrays into oParams hash Useful if generally parsing is done when bHashMode is FALSE. Hash operations are not the fastest, so its best not to use this function.

Dispose ( ) : void
GenerateHTML ( ) : string

Generates HTML based on current chunk's data Note: this is not a high performance method and if you want ORIGINAL HTML that was parsed to create this chunk then use relevant HTMLparser method to obtain such HTML then you should use function of parser: SetRawHTML

GenerateParamHTML ( string sParam, string sValue, char cParamChar ) : string

Generates HTML for param/value pair

GenerateParamsHTML ( ) : string

Generates HTML for params in this chunk

GetParamValue ( string sParam ) : string

Returns value of a parameter

HTMLchunk ( bool p_bHashMode ) : System

Initialises new HTMLchunk

MakeSafeParamValue ( string sLine, char cQuoteChar ) : string

Makes parameter value safe to be used in param - this will check for any conflicting quote chars, but not full entity-encoding

SetEncoding ( Encoding p_oEnc ) : void

Sets encoding to be used for conversion of binary data into string

비공개 메소드들

메소드 설명
Dispose ( bool bDisposing ) : void

메소드 상세

AddParam() 공개 메소드

Adds tag parameter to the chunk
public AddParam ( string sParam, string sValue, byte cParamChar ) : void
sParam string Parameter name (ie color)
sValue string Value of the parameter (ie white)
cParamChar byte
리턴 void

Clear() 공개 메소드

Clears chunk preparing it for
public Clear ( ) : void
리턴 void

ConvertParamsToHash() 공개 메소드

This function will convert parameters stored in sParams/sValues arrays into oParams hash Useful if generally parsing is done when bHashMode is FALSE. Hash operations are not the fastest, so its best not to use this function.
public ConvertParamsToHash ( ) : void
리턴 void

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

GenerateHTML() 공개 메소드

Generates HTML based on current chunk's data Note: this is not a high performance method and if you want ORIGINAL HTML that was parsed to create this chunk then use relevant HTMLparser method to obtain such HTML then you should use function of parser: SetRawHTML
public GenerateHTML ( ) : string
리턴 string

GenerateParamHTML() 공개 메소드

Generates HTML for param/value pair
public GenerateParamHTML ( string sParam, string sValue, char cParamChar ) : string
sParam string Param
sValue string Value (empty if not specified)
cParamChar char
리턴 string

GenerateParamsHTML() 공개 메소드

Generates HTML for params in this chunk
public GenerateParamsHTML ( ) : string
리턴 string

GetParamValue() 공개 메소드

Returns value of a parameter
public GetParamValue ( string sParam ) : string
sParam string Parameter
리턴 string

HTMLchunk() 공개 메소드

Initialises new HTMLchunk
public HTMLchunk ( bool p_bHashMode ) : System
p_bHashMode bool Sets
리턴 System

MakeSafeParamValue() 공개 정적인 메소드

Makes parameter value safe to be used in param - this will check for any conflicting quote chars, but not full entity-encoding
public static MakeSafeParamValue ( string sLine, char cQuoteChar ) : string
sLine string Line of text
cQuoteChar char Quote char used in param - any such chars in text will be entity-encoded
리턴 string

SetEncoding() 공개 메소드

Sets encoding to be used for conversion of binary data into string
public SetEncoding ( Encoding p_oEnc ) : void
p_oEnc System.Text.Encoding Encoding object
리턴 void

프로퍼티 상세

MAX_PARAMS 공개적으로 정적으로 프로퍼티

Maximum number of parameters in a tag - should be high enough to fit most sensible cases
public static int MAX_PARAMS
리턴 int

TEXT_CAPACITY 공개적으로 정적으로 프로퍼티

Maximum default capacity of buffer that will keep data
public static int TEXT_CAPACITY
리턴 int

bClosure 공개적으로 프로퍼티

If true then it must be closed tag
public bool bClosure
리턴 bool

bComments 공개적으로 프로퍼티

If true then it must be comments tag
public bool bComments
리턴 bool

bEndClosure 공개적으로 프로퍼티

If true then it must be closed tag and closure sign / was at the END of tag, ie this is a SOLO tag
public bool bEndClosure
리턴 bool

bEntities 공개적으로 프로퍼티

True if entities were present (and transformed) in the original HTML
public bool bEntities
리턴 bool

bHashMode 공개적으로 프로퍼티

If true then tag params will be kept in a hash rather than in a fixed size arrays. This will be slow down parsing, but make it easier to use.
public bool bHashMode
리턴 bool

bLtEntity 공개적으로 프로퍼티

Set to true if < entity (tag start) was found
public bool bLtEntity
리턴 bool

cParamChars 공개적으로 프로퍼티

Character used to quote param's value: it is taken actually from parsed HTML
public byte[] cParamChars
리턴 byte[]

iChunkLength 공개적으로 프로퍼티

Length of the chunk in bHTML data array
public int iChunkLength
리턴 int

iChunkOffset 공개적으로 프로퍼티

Offset in bHTML data array at which this chunk starts
public int iChunkOffset
리턴 int

iParams 공개적으로 프로퍼티

Number of parameters and values stored in sParams array, OR in oParams hashtable if bHashMode is true
public int iParams
리턴 int

oEnc 공개적으로 프로퍼티

Encoder to be used for conversion of binary data into strings, Encoding.Default is used by default, but it can be changed if top level user of the parser detects that encoding was different
public Encoding oEnc
리턴 Encoding

oHTML 공개적으로 프로퍼티

For TAGS: it stores raw HTML that was parsed to generate thus chunk will be here UNLESS HTMLparser was configured not to store it there as it can improve performance

For TEXT or COMMENTS: actual text or comments - you MUST call Finalise(); first.

public string oHTML
리턴 string

oParams 공개적으로 프로퍼티

Hashtable with tag parameters: keys are param names and values are param values. ONLY used if bHashMode is set to TRUE.
public System.Collections.Generic.Dictionary oParams
리턴 object>.System.Collections.Generic.Dictionary

oType 공개적으로 프로퍼티

Chunk type showing whether its text, open or close tag, comments or script. WARNING: if type is comments or script then you have to manually call Finalise(); method in order to have actual text of comments/scripts in oHTML variable
public HTMLchunkType oType
리턴 HTMLchunkType

sParams 공개적으로 프로퍼티

Param names will be stored here - actual number is in iParams. ONLY used if bHashMode is set to FALSE.
public string[] sParams
리턴 string[]

sTag 공개적으로 프로퍼티

If its open/close tag type then this is where lowercased Tag will be kept
public string sTag
리턴 string

sValues 공개적으로 프로퍼티

Param values will be stored here - actual number is in iParams. ONLY used if bHashMode is set to FALSE.
public string[] sValues
리턴 string[]