CodeView  Version0.4
 All Classes Functions Variables
Public Member Functions | List of all members
cv::Format_java Class Reference

An implementation of a formater for Java. More...

#include <format_java.h>

Inheritance diagram for cv::Format_java:
cv::Format

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 CodeViewStyleGetStyle (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...
 
int GetFoldLevel (const os::String &cLine, int nOldFoldLevel)
 Find foldable sections. More...
 

Detailed Description

An implementation of a formater for Java.

Author
Andreas Engh-Halstvedt (aeh@o.nosp@m.pera.nosp@m.mail..nosp@m.com)

Member Function Documentation

int cv::Format_java::GetFoldLevel ( const os::String &  cLine,
int  nOldFoldLevel 
)
virtual

Find foldable sections.

Returns nOldFoldLevel + 1 if cLine contains something that can start a foldable section. Returns nOldFoldLevel - 1 if the line contains something that can end a foldable section. If the line doesn't contain any of those, nOldFoldLevel is returned unchanged.

Parameters
cLineA line parse.
nOldFoldLevelSet to 0 in the first call. In subsequent calls, it should be passed the value returned by the previous call.

Reimplemented from cv::Format.

os::String cv::Format_java::GetIndentString ( const os::String &  cText,
bool  bUseTabs,
uint  nTabSize 
)
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".

Parameters
cTextThe line to analyze.
bUseTabsUse TABs to indent.
nTabSizeLength of each TAB.
Returns
The string to prefix the next string with.
See Also
CodeView::setTabSize()
CodeView::getTabSize()
CodeView::setUseTab()
CodeView::getUseTab()

Implements cv::Format.

uint cv::Format_java::GetNextWordLimit ( const os::String &  cLine,
uint  nChr 
)
virtual

Get the character index of the next word limit.

What is considered a word is up to the format.

Parameters
nLineThe line to analyze.
nChrThe character index to start from.
Returns
The character index of the next word limit, or the length if the string if none are found.

Implements cv::Format.

uint cv::Format_java::GetPreviousWordLimit ( const os::String &  cLine,
uint  nChr 
)
virtual

Get the character index of the previous word limit.

What is considered a word is up to the format.

Parameters
nLineThe line to analyze.
nChrThe character index to start from.
Returns
The character index of the previous word limit, or 0 if the string if none are found.

Implements cv::Format.

const CodeViewStyle& cv::Format_java::GetStyle ( char  nStyle)
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.

Parameters
nStyleThe number of the style to return.
Returns
The color to display the given style with.

Implements cv::Format.

uint cv::Format_java::GetStyleCount ( )
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.

Returns
The number of styles supported by this format.

Implements cv::Format.

const os::String& cv::Format_java::GetStyleName ( char  nStyle)
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.

Parameters
styleThe number of the style to return.
Returns
A string containing the display name of the given style.

Implements cv::Format.

CodeViewContext cv::Format_java::Parse ( const os::String &  cText,
os::String &  cStyle,
CodeViewContext  nContext 
)
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.

Parameters
textThe line of text to parse.
styleA string to put the styles into.
contextA value representing the current context.
Returns
A value representing the new context.

Implements cv::Format.

void cv::Format_java::SetStyle ( char  nStyle,
const CodeViewStyle cStyle 
)
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.

Parameters
nStyleThe number of the style to set.
cStyleThe color to display the given style with.

Implements cv::Format.


The documentation for this class was generated from the following file: