from small one page howto to huge articles all in one place
 

search text in:





Poll
Which kernel version do you use?





poll results

Last additions:
using iotop to find disk usage hogs

using iotop to find disk usage hogs

words:

887

views:

195651

userrating:

average rating: 1.7 (102 votes) (1=very good 6=terrible)


May 25th. 2007:
Words

486

Views

252057

why adblockers are bad


Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

words:

161

views:

140922

userrating:

average rating: 1.4 (42 votes) (1=very good 6=terrible)


April, 26th. 2006:

Druckversion
You are here: manpages





UNICODE::LINEBREAK

Section: Courier Unicode Library (3)
Updated: 07/29/2015
Index Return to Main Contents
 

NAME

unicode::linebreak_callback_base, unicode::linebreak_callback_save_buf, unicode::linebreakc_callback_base, unicode::linebreak_iter, unicode::linebreakc_iter - unicode line-breaking rules  

SYNOPSIS

#include <courier-unicode.h>

class linebreak : public unicode::linebreak_callback_base {

public:

    using unicode::linebreak_callback_base::operator<<;
    using unicode::linebreak_callback_base::operator();
    int callback(int linebreak_code)
    {
        // ...
    }
};

unicode_char c;
std::vector<unicode_char> buf;

linebreak compute_linebreak;

compute_linebreak.set_opts(UNICODE_LB_OPT_SYBREAK);
compute_linebreak << c;

compute_linebreak(buf);
compute_linebreak(buf.begin(), buf.end());

compute_linebreak.finish();

// ...

unicode::linebreak_callback_save_buf linebreaks;

std::list<int> lb=linebreaks.lb_buf;

class linebreakc : public unicode::linebreakc_callback_base {

public:

    using unicode::linebreak_callback_base::operator<<;
    using unicode::linebreak_callback_base::operator();
    int callback(int linebreak_code, unicode_char ch)
    {
        // ...
    }
};

// ...

std::vector<unicode_char> buf;

typedef unicode::linebreak_iter<std::vector<unicode_char>::const_iterator> iter_t;

iter_t beg_iter(buf.begin(), buf.end()), end_iter;

beg_iter.set_opts(UNICODE_LB_OPT_SYBREAK);

std::vector<int> linebreaks;

std::copy(beg_iter, end_iter, std::back_insert_iterator<std::vector<int>>(linebreaks));

// ...

typedef unicode::linebreakc_iter<std::vector<unicode_char>::const_iterator> iter_t;

iter_t beg_iter(buf.begin(), buf.end()), end_iter;

beg_iter.set_opts(UNICODE_LB_OPT_SYBREAK);

std::vector<std::pair<int, unicode_char>> linebreaks;

std::copy(beg_iter, end_iter, std::back_insert_iterator<std::vector<int>>(linebreaks));
 

DESCRIPTION

unicode::linebreak_callback_base is a C++ binding for the unicode line-breaking rule implementation described in unicode_line_break(3).

Subclass unicode::linebreak_callback_base and implement callback() that's virtually inherited from unicode::linebreak_callback_base. The callback() callback function receives the output values from the line-breaking algorithm, the UNICODE_LB_MANDATORY, UNICODE_LB_NONE, or the UNICODE_LB_ALLOWED value, for each unicode character.

callback() should return 0. A non-zero return reports an error, that stops the line-breaking algorithm. See unicode_line_break(3) for more information.

The alternate unicode::linebreakc_callback_base interface uses a virtually inherited callback() that receives two parameters, the line-break code value, and the corresponding unicode character.

The input unicode characters for the line-breaking algorithm are provided by the << operator, one unicode character at a time; or by the () operator, passing either a container, or a beginning and an ending iterator value for an input sequence of unicode characters. finish() indicates the end of the unicode character sequence.

set_opts sets line-breaking options (see unicode_lb_set_opts() for more information).

unicode::linebreak_callback_save_buf is a subclass that implements callback() by saving the linebreaks codes into a std::list.

The linebreak_iter template implements an input iterator over ints. The template parameter is an input iterator over unicode chars. The constructor's parameters are a beginning and an ending iterator value for a sequence of unicode_char. This constructs the beginning iterator value for a sequence of ints consisting of line-break values (UNICODE_LB_MANDATORY, UNICODE_LB_NONE, or UNICODE_LB_ALLOWED) corresponding to each unicode_char in the underlying sequence. The default constructor creates the ending iterator value for the sequence.

The iterator implements a set_opts() methods that sets the options for the line-breaking algorithm.

The linebreakc_iter template implements a similar input iterator, with the difference that it ends up iterating over a std::pair of line-breaking values and the corresponding unicode_char from the underlying input sequence.  

SEE ALSO

courier-unicode(7), unicode_line_break(3).  

AUTHOR

Sam Varshavchik

Author


 

Index

NAME
SYNOPSIS
DESCRIPTION
SEE ALSO
AUTHOR





Support us on Content Nation
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2020 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS : buttonmaker
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 18.6 ms