Source-highlight Library
linenumgenerator.h
1
//
2
// Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2004-2008
3
//
4
// Copyright: See COPYING file that comes with this distribution
5
//
6
7
#ifndef LINENUMGENERATOR_H_
8
#define LINENUMGENERATOR_H_
9
10
#include <string>
11
12
#include "textstyle.h"
13
14
namespace
srchilite
{
15
19
class
LineNumGenerator
{
21
unsigned
int
digitNum
;
22
24
char
padding
;
25
27
TextStyle
lineStyle
;
28
30
TextStyle
anchorStyle
;
31
33
std::string
anchorLinePrefix
;
34
35
public
:
36
LineNumGenerator
(
const
TextStyle
&
lineStyle
,
unsigned
int
digitNum
,
char
padding
=
'0'
);
37
~
LineNumGenerator
();
38
39
void
setAnchorStyle(
const
TextStyle
&_anchorStyle) {
40
anchorStyle
= _anchorStyle;
41
}
42
43
void
setAnchorPrefix(
const
std::string &_anchorLinePrefix) {
44
anchorLinePrefix
= _anchorLinePrefix;
45
}
46
47
void
setDigitNum(
unsigned
int
_digitNum) {
48
digitNum
= _digitNum;
49
}
50
56
const
std::string
generateLine
(
unsigned
int
line);
57
};
58
59
}
60
61
#endif
/*LINENUMGENERATOR_H_*/
srchilite::LineNumGenerator::padding
char padding
character to use for padding the line number
Definition:
linenumgenerator.h:24
srchilite
C++ class: doctemplate.h.
Definition:
bufferedoutput.cpp:13
srchilite::LineNumGenerator
Generates line numbers in the output.
Definition:
linenumgenerator.h:19
srchilite::LineNumGenerator::generateLine
const std::string generateLine(unsigned int line)
Generates a string representing the formatting of the passed line number.
Definition:
linenumgenerator.cpp:31
srchilite::LineNumGenerator::lineStyle
TextStyle lineStyle
for actually formatting the line number
Definition:
linenumgenerator.h:27
srchilite::TextStyle
Represents a formatting template where there can be some variables (starting with $,...
Definition:
textstyle.h:36
srchilite::LineNumGenerator::anchorStyle
TextStyle anchorStyle
for possible line anchor generation (can be null)
Definition:
linenumgenerator.h:30
srchilite::LineNumGenerator::anchorLinePrefix
std::string anchorLinePrefix
when generating an anchor for a line, use this prefix for the anchor name
Definition:
linenumgenerator.h:33
srchilite::LineNumGenerator::digitNum
unsigned int digitNum
number of digits to represent line number
Definition:
linenumgenerator.h:21
linenumgenerator.h
Generated by
1.8.17