ARB
Main Page
Namespaces
Classes
Files
File List
File Members
CONVERTALN
wrap.h
Go to the documentation of this file.
1
#ifndef WRAP_H
2
#define WRAP_H
3
4
class
WrapMode
:
virtual
Noncopyable
{
5
char
*separators;
6
7
bool
allowed_to_wrap()
const
{
return
separators; }
8
const
char
*get_seps()
const
{
ca_assert
(allowed_to_wrap());
return
separators; }
9
int
wrap_pos(
const
char
*
str
,
int
wrapCol)
const
;
10
11
const
char
*print_return_wrapped(
Writer
& write,
const
char
*
const
content,
const
int
len,
const
int
rest_width)
const
;
12
13
public
:
14
WrapMode
(
const
char
*separators_) : separators(nulldup(separators_)) {}
15
WrapMode
(
bool
allowWrap) : separators(allowWrap ?
ARB_strdup
(
WORD_SEP
) :
NULp
) {}
// true->wrap words, false->wrapping forbidden
16
~WrapMode
() { free(separators); }
17
18
void
print
(
Writer
& write,
const
char
*first_prefix,
const
char
*other_prefix,
const
char
*content,
int
max_width)
const
;
19
};
20
21
#else
22
#error wrap.h included twice
23
#endif // WRAP_H
ca_assert
#define ca_assert(cond)
Definition:
global.h:33
ARB_strdup
char * ARB_strdup(const char *str)
Definition:
arb_string.h:27
WORD_SEP
#define WORD_SEP
Definition:
global.h:117
WrapMode
Definition:
wrap.h:4
Writer
Definition:
reader.h:95
WrapMode::WrapMode
WrapMode(bool allowWrap)
Definition:
wrap.h:15
WrapMode::WrapMode
WrapMode(const char *separators_)
Definition:
wrap.h:14
WrapMode::print
void print(Writer &write, const char *first_prefix, const char *other_prefix, const char *content, int max_width) const
Definition:
wrap.cxx:52
WrapMode::~WrapMode
~WrapMode()
Definition:
wrap.h:16
NULp
#define NULp
Definition:
cxxforward.h:116
char
Noncopyable
Definition:
arbtools.h:39
Generated by
1.8.8