MFC development help document: XML format of Outline parser

BCGControlBar  ("Business Components Gallery ControlBar") is an MFC extension library that allows you to create a rich set of professionally designed Microsoft Office and Microsoft Visual Studio with fully customized options (ribbon, customizable toolbars, menus, etc.) Application GUI controls, such as charts, calendars, grids, editors, Gantt charts and many other controls. The BCGControlBar library has more than 500 MFC extension classes that have been fully designed, tested and fully documented. Our components can be easily integrated into your application and save you hundreds of development and debugging time.

BCGControlBar Pro for MFC v31.0 official version download

This article introduces the XML file format used with CBCGPOutlineParser and the automatic overview function of the edit control . The XML parser is called by calling CBCGPEditCtrl::LoadOutlineParserXMLSettings .

The structure used for the outline parser is as follows:

 

<SETTINGS>
<OUTLINE_DATA>
<IgnoreOneLineBlocks></IgnoreOneLineBlocks>
<EscapeSequences>
<EscapeSequence></EscapeSequence>
</EscapeSequences>

<BLOCKS>
<BLOCK>
<Start></Start>
<End></End>
<ReplaceString></ReplaceString>
<AllowNestedBlocks></AllowNestedBlocks>
<Ignore></Ignore>
</BLOCK>
</BLOCKS>
</OUTLINE_DATA>
</SETTINGS>

 

Apart from the main "SETTINGS" label, there are no other mandatory labels.

The "OUTLINE_DATA" tag defines the general outline parser settings.

  • The "IgnoreOneLineBlocks" tag defines whether the edit control should treat a line block as collapsible, and the default is "False".
  • The "EscapeSequences" tag defines a list of escape sequences.
  • The "EscapeSequence" tag represents a single escape sequence.
  • The "BLOCKS" tag is used for the grammar definition of the language. Each block specifies the rules and how the outline parser finds the outline collapsible area. This method is useful when you need to define a set of automatic outlining areas of the same language syntax block. For each block, the XML parser will call CBCGPOutlineParser::AddBlockType .
  • "BLOCK" mark represents a single block

Default XML settings for C++:

 

<SETTINGS>
<OUTLINE_DATA>
<IgnoreOneLineBlocks>True</IgnoreOneLineBlocks>
<IncludeSpaceLines>True</IncludeSpaceLines>
<EscapeSequences>
<EscapeSequence>\\\"</EscapeSequence>
</EscapeSequences>
<BLOCKS>
<BLOCK>
<Start>\\\"</Start>
<End></End>
<ReplaceString></ReplaceString>
<AllowNestedBlocks>False</AllowNestedBlocks>
<Ignore>True</Ignore>
</BLOCK>

<BLOCK>
<Start>\"</Start>
<End>\"</End>
<ReplaceString>\"\"</ReplaceString>
<AllowNestedBlocks>False</AllowNestedBlocks>
<Ignore>True</Ignore>
</BLOCK>

<BLOCK>
<Start>{</Start>
<End>}</End>
<ReplaceString>..</ReplaceString>
<KEYWORDS>
<Keyword>else</Keyword>
<Keyword>struct</Keyword>
<Keyword>enum</Keyword>
<Keyword>switch</Keyword>
<Keyword>catch</Keyword>
<Keyword>try</Keyword>
<Keyword>for</Keyword>
<Keyword>operator</Keyword>
<Keyword>class</Keyword>
<Keyword>if</Keyword>
<Keyword>union</Keyword>
<Keyword>do</Keyword>
<Keyword>while</Keyword>
<Keyword>namespace</Keyword>
</KEYWORDS>
</BLOCK>

<BLOCK>
<Start>{</Start>
<End>}</End>
<ReplaceString>...</ReplaceString>
</BLOCK>

<BLOCK>
<Start>//</Start>
<End>\n</End>
<ReplaceString>/**/</ReplaceString>
<AllowNestedBlocks>False</AllowNestedBlocks>
</BLOCK>

<BLOCK>
<Start>/*</Start>
<End>*/</End>
<ReplaceString>/**/</ReplaceString>
<AllowNestedBlocks>False</AllowNestedBlocks>
</BLOCK>
</BLOCKS>
</OUTLINE_DATA>
</SETTINGS>

Guess you like

Origin blog.csdn.net/AABBbaby/article/details/111942341