Source-highlight Library
srchilite::LineNumGenerator Class Reference

Generates line numbers in the output. More...

#include <linenumgenerator.h>

Collaboration diagram for srchilite::LineNumGenerator:

Public Member Functions

 LineNumGenerator (const TextStyle &lineStyle, unsigned int digitNum, char padding= '0')
 
void setAnchorStyle (const TextStyle &_anchorStyle)
 
void setAnchorPrefix (const std::string &_anchorLinePrefix)
 
void setDigitNum (unsigned int _digitNum)
 
const std::string generateLine (unsigned int line)
 Generates a string representing the formatting of the passed line number. More...
 

Private Attributes

unsigned int digitNum
 number of digits to represent line number
 
char padding
 character to use for padding the line number
 
TextStyle lineStyle
 for actually formatting the line number
 
TextStyle anchorStyle
 for possible line anchor generation (can be null)
 
std::string anchorLinePrefix
 when generating an anchor for a line, use this prefix for the anchor name
 

Detailed Description

Generates line numbers in the output.

Member Function Documentation

const std::string srchilite::LineNumGenerator::generateLine ( unsigned int  line)

Generates a string representing the formatting of the passed line number.

Parameters
line
Returns
the formatted line

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