C# Class SyntaxHighlighter.RtfParser

簡易 RTF パーサー。 ぶっちゃけ、Visual Studio のテキストエディターが出力する RTF 以外対応する気まるでなし。
Inheritance: IParser
Mostra file Open project: ufcpp/UfcppSample Class Usage Examples

Public Properties

Property Type Description
ColorToTagNameCsharp string>.IDictionary
ColorToTagNameXml string>.IDictionary

Public Methods

Method Description
Parse ( string text ) : string

Visual Studio のソースエディターからコピった RTF 文章を、ufcpp で使ってる XML 形式に変換する。

RtfParser ( Mode mode ) : System

Private Methods

Method Description
DecodeU ( Match m ) : string
FormatTag ( string tag ) : string
GetCfNumber ( Match m ) : int
GetTag ( Match m ) : string
InsertTag ( Match m ) : string

RTF の \cf* を XML タグに置き換える。

ReadHeader ( string text ) : void

RTF のヘッダー情報を読み込む。

RemoveWhiteSpaceElement ( Match m ) : string

中に空白文字しかないタグを消す。

ReplaceUnicodeEscape ( Match m ) : string
ReplaceUnicodeEscape ( string s ) : string
TagReplace ( string text ) : string

< > & にしたり、 \par を消したり、 \cf* を XML タグに変換したり。

Method Details

Parse() public method

Visual Studio のソースエディターからコピった RTF 文章を、ufcpp で使ってる XML 形式に変換する。
public Parse ( string text ) : string
text string RTF 文章
return string

RtfParser() public method

public RtfParser ( Mode mode ) : System
mode Mode
return System

Property Details

ColorToTagNameCsharp public_oe static_oe property

public static IDictionary ColorToTagNameCsharp
return string>.IDictionary

ColorToTagNameXml public_oe static_oe property

public static IDictionary ColorToTagNameXml
return string>.IDictionary