HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
UT_StringPager.h
Go to the documentation of this file.
1
/*
2
* PROPRIETARY INFORMATION. This software is proprietary to
3
* Side Effects Software Inc., and is not to be reproduced,
4
* transmitted, or disclosed in any way without written permission.
5
*
6
* NAME: UT_StringPager.h ( Utility Library, C++ )
7
*
8
* COMMENTS:
9
* A fixed-width pager, in the sense of less or more, that lets
10
* one dump text to it and then retrieve in a word-wrapped manner.
11
*/
12
13
#ifndef __UT_StringPager_h__
14
#define __UT_StringPager_h__
15
16
#include "
UT_API.h
"
17
18
#include "
UT_Assert.h
"
19
#include "
UT_StringHolder.h
"
20
#include "
UT_StringArray.h
"
21
#include "
UT_WorkBuffer.h
"
22
23
#include <
SYS/SYS_Inline.h
>
24
#include <
SYS/SYS_String.h
>
25
#include <
SYS/SYS_Types.h
>
26
27
class
UT_API
UT_StringPager
28
{
29
public
:
30
UT_StringPager
(
int
width
= 80,
int
leftmargin = 0,
int
rightmargin = 3)
31
: myWidth(
width
)
32
, myLeftMargin(leftmargin)
33
, myRightMargin(rightmargin)
34
{}
35
36
int
getLeftMargin
()
const
{
return
myLeftMargin; }
37
int
getRightMargin
()
const
{
return
myRightMargin; }
38
int
getWidth
()
const
{
return
myWidth; }
39
40
// This only affects future appended text, not the existing paged data.
41
void
setLeftMargin
(
int
leftmargin) { myLeftMargin = leftmargin; }
42
void
setRightMargin
(
int
rightmargin) { myRightMargin = rightmargin; }
43
void
setWidth
(
int
width
) { myWidth =
width
; }
44
45
UT_StringHolder
getLine(
exint
line)
const
;
46
exint
numLines
()
const
{
return
myLines.entries()+1; }
47
void
clear();
48
49
// Returns all the lines joined with \n
50
// No \n on final line. (so empty -> empty)
51
UT_StringHolder
buildText()
const
;
52
53
// Explicitly append provided text
54
void
appendText(
const
char
*text);
55
56
// Appends a new line
57
void
newLine();
58
59
private
:
60
// Formatting options
61
int
myWidth;
62
int
myLeftMargin, myRightMargin;
63
64
// Current text buffer, myCurLine is always the last line.
65
UT_StringArray
myLines;
66
UT_WorkBuffer
myCurLine;
67
};
68
69
#endif
UT_WorkBuffer
Definition:
UT_WorkBuffer.h:74
exint
int64 exint
Definition:
SYS_Types.h:125
UT_StringArray.h
UT_API.h
UT_API
#define UT_API
Definition:
UT_API.h:14
UT_StringPager::numLines
exint numLines() const
Definition:
UT_StringPager.h:46
UT_Assert.h
SYS_Inline.h
UT_StringHolder
Definition:
UT_StringHolder.h:999
UT_StringArray
Definition:
UT_StringArray.h:24
SYS_Types.h
UT_WorkBuffer.h
UT_StringPager::setRightMargin
void setRightMargin(int rightmargin)
Definition:
UT_StringPager.h:42
UT_StringPager
Definition:
UT_StringPager.h:27
UT_StringPager::getWidth
int getWidth() const
Definition:
UT_StringPager.h:38
UT_StringPager::setLeftMargin
void setLeftMargin(int leftmargin)
Definition:
UT_StringPager.h:41
UT_StringHolder.h
UT_StringPager::getRightMargin
int getRightMargin() const
Definition:
UT_StringPager.h:37
width
GLint GLsizei width
Definition:
glcorearb.h:103
UT_StringPager::UT_StringPager
UT_StringPager(int width=80, int leftmargin=0, int rightmargin=3)
Definition:
UT_StringPager.h:30
SYS_String.h
UT_StringPager::setWidth
void setWidth(int width)
Definition:
UT_StringPager.h:43
UT_StringPager::getLeftMargin
int getLeftMargin() const
Definition:
UT_StringPager.h:36
UT
UT_StringPager.h
Generated on Sun Nov 17 2024 03:03:54 for HDK by
1.8.6