An implementation of a formater for HTML. More...
#include <format_html.h>
Public Member Functions | |
uint | GetStyleCount () |
Get the number of different styles supported by this format. More... | |
const os::String & | GetStyleName (char) |
Get the name of the given style. More... | |
void | SetStyle (char, const CodeViewStyle &) |
Set the color used to display the given style. More... | |
const CodeViewStyle & | GetStyle (char) |
Get the color used to display the given style. More... | |
CodeViewContext | Parse (const os::String &cLine, os::String &cFormat, CodeViewContext cookie) |
Parse a line and assign styles to each character. More... | |
os::String | GetIndentString (const os::String &cText, bool bUseTabs, uint nTabSize) |
Get the string used to prefix the next line. More... | |
uint | GetPreviousWordLimit (const os::String &, uint nChr) |
Get the character index of the previous word limit. More... | |
uint | GetNextWordLimit (const os::String &, uint nChr) |
Get the character index of the next word limit. More... | |
Public Member Functions inherited from cv::Format | |
virtual int | GetFoldLevel (const os::String &cLine, int nOldFoldLevel) |
Find foldable sections. More... | |
An implementation of a formater for HTML.
|
virtual |
Get the string used to prefix the next line.
The format will analyze the given line and return a string to be used as prefix to the next line. This may be used to implement auto indenting of code.
As an example, for C++ the line "\t\tFlush();" may return the string "\t\t".
cText | The line to analyze. |
bUseTabs | Use TABs to indent. |
nTabSize | Length of each TAB. |
Implements cv::Format.
|
virtual |
Get the character index of the next word limit.
What is considered a word is up to the format.
nLine | The line to analyze. |
nChr | The character index to start from. |
Implements cv::Format.
|
virtual |
Get the character index of the previous word limit.
What is considered a word is up to the format.
nLine | The line to analyze. |
nChr | The character index to start from. |
Implements cv::Format.
|
virtual |
Get the color used to display the given style.
This method must return a color for each of the styles in the range from 0 through getStyleCount()-1. The method is not defined for methods outside of this range, but implementors are encouraged to handle this gracefully.
nStyle | The number of the style to return. |
Implements cv::Format.
|
virtual |
Get the number of different styles supported by this format.
Each format has a maximum number of styles it may use. This number can be in the range 1-255, and should not change during use, but the format is not required to actually use all of them.
Implements cv::Format.
|
virtual |
Get the name of the given style.
This method must return a name for each of the styles in the range from 0 through getStyleCount()-1. The method is not defined for styles outside of this range, but implementors are encouraged to handle this gracefully.
The names are intended used in configuration dialogs.
style | The number of the style to return. |
Implements cv::Format.
|
virtual |
Parse a line and assign styles to each character.
The method will parse a single line of text and store the correct style to use for each character. After the method returns, character text[n] should be displayed using the style stored in style[n].
The format is responsible for resizing the style string to the correct size.
To correctly parse constructs spanning multiple lines, the format may store per-line context information in a 32-bit value. For the first line this value is defined to be 0, but for all other lines the value returned for the previous line should be passed as the context parameter.
text | The line of text to parse. |
style | A string to put the styles into. |
context | A value representing the current context. |
Implements cv::Format.
|
virtual |
Set the color used to display the given style.
This method must accept a color for each of the styles in the range from 0 through getStyleCount()-1. The method is not defined for methods outside of this range, but implementors are encouraged to handle this gracefully.
nStyle | The number of the style to set. |
cStyle | The color to display the given style with. |
Implements cv::Format.