A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/ubiditransform_8h.html below:

ICU 77.1: common/unicode/ubiditransform.h File Reference

C API: Bidi Transformations. More...

Go to the source code of this file.

U_CAPI uint32_t  ubiditransform_transform (UBiDiTransform *pBiDiTransform, const UChar *src, int32_t srcLength, UChar *dest, int32_t destSize, UBiDiLevel inParaLevel, UBiDiOrder inOrder, UBiDiLevel outParaLevel, UBiDiOrder outOrder, UBiDiMirroring doMirroring, uint32_t shapingOptions, UErrorCode *pErrorCode)   Performs transformation of text from the bidi layout defined by the input ordering scheme to the bidi layout defined by the output ordering scheme, and applies character mirroring and Arabic shaping operations. More...
  U_CAPI UBiDiTransformubiditransform_open (UErrorCode *pErrorCode)   Allocates a UBiDiTransform object. More...
  U_CAPI void  ubiditransform_close (UBiDiTransform *pBidiTransform)   Deallocates the given UBiDiTransform object. More...
 

C API: Bidi Transformations.

Definition in file ubiditransform.h.

◆ UBiDiTransform

Forward declaration of the UBiDiTransform structure that stores information used by the layout transformation engine.

Stable:
ICU 58

Definition at line 1 of file ubiditransform.h.

◆ UBiDiMirroring

UBiDiMirroring indicates whether or not characters with the "mirrored" property in RTL runs should be replaced with their mirror-image counterparts.

See also
UBIDI_DO_MIRRORING
ubidi_setReorderingOptions
ubidi_writeReordered
ubidi_writeReverse
Stable:
ICU 58
Enumerator UBIDI_MIRRORING_OFF 

0: Constant indicating that character mirroring should not be performed.

This is the default.

Stable:
ICU 58
UBIDI_MIRRORING_ON 

1: Constant indicating that character mirroring should be performed.

This corresponds to calling ubidi_writeReordered or ubidi_writeReverse with the UBIDI_DO_MIRRORING option bit set.

Stable:
ICU 58

Definition at line 94 of file ubiditransform.h.

◆ UBiDiOrder

UBiDiOrder indicates the order of text.

This bidi transformation engine supports all possible combinations (4 in total) of input and output text order:

Enumerator UBIDI_LOGICAL 

0: Constant indicating a logical order.

This is the default for input text.

Stable:
ICU 58
UBIDI_VISUAL 

1: Constant indicating a visual order.

This is a default for output text.

Stable:
ICU 58

Definition at line 71 of file ubiditransform.h.

◆ ubiditransform_close()

Deallocates the given UBiDiTransform object.

Stable:
ICU 58
◆ ubiditransform_open()

Allocates a UBiDiTransform object.

This object can be reused, e.g. with different ordering schemes, mirroring or shaping options.

Note:The object can only be reused in the same thread. All other threads should allocate a new UBiDiTransform object before using it.

Example of usage:



text1, -1, text2, -1,

&errorCode);

text2, -1, text3, -1,

0, &errorCode);

*

@ UBIDI_LTR

Left-to-right text.

@ UBIDI_RTL

Right-to-left text.

U_CAPI uint32_t ubiditransform_transform(UBiDiTransform *pBiDiTransform, const UChar *src, int32_t srcLength, UChar *dest, int32_t destSize, UBiDiLevel inParaLevel, UBiDiOrder inOrder, UBiDiLevel outParaLevel, UBiDiOrder outOrder, UBiDiMirroring doMirroring, uint32_t shapingOptions, UErrorCode *pErrorCode)

Performs transformation of text from the bidi layout defined by the input ordering scheme to the bidi...

struct UBiDiTransform UBiDiTransform

Forward declaration of the UBiDiTransform structure that stores information used by the layout transf...

U_CAPI UBiDiTransform * ubiditransform_open(UErrorCode *pErrorCode)

Allocates a UBiDiTransform object.

@ UBIDI_LOGICAL

0: Constant indicating a logical order.

@ UBIDI_VISUAL

1: Constant indicating a visual order.

@ UBIDI_MIRRORING_ON

1: Constant indicating that character mirroring should be performed.

#define U_SHAPE_DIGITS_EN2AN

Digit shaping option: Replace European digits (U+0030...) by Arabic-Indic digits.

UErrorCode

Standard ICU4C error code type, a substitute for exceptions.

@ U_ZERO_ERROR

No error, no warning.

The UBiDiTransform object must be deallocated by calling ubiditransform_close().

Returns
An empty UBiDiTransform object.
Stable:
ICU 58
◆ ubiditransform_transform() U_CAPI uint32_t ubiditransform_transform ( UBiDiTransformpBiDiTransform, const UCharsrc, int32_t  srcLength, UChardest, int32_t  destSize, UBiDiLevel  inParaLevel, UBiDiOrder  inOrder, UBiDiLevel  outParaLevel, UBiDiOrder  outOrder, UBiDiMirroring  doMirroring, uint32_t  shapingOptions, UErrorCodepErrorCode  )

Performs transformation of text from the bidi layout defined by the input ordering scheme to the bidi layout defined by the output ordering scheme, and applies character mirroring and Arabic shaping operations.

In terms of UBiDi, such a transformation implies:

An "ordering scheme" encompasses the base direction and the order of text, and these characteristics must be defined by the caller for both input and output explicitly .

There are 36 possible combinations of <input, output> ordering schemes, which are partially supported by UBiDi already. Examples of the currently supported combinations:

All combinations that involve the Visual RTL scheme are unsupported by UBiDi, for instance:

Example of usage of the transformation engine:

  UChar

text1[] = {

'a'

,

'b'

,

'c'

, 0x0625,

'1'

, 0};

UChar

text2[] = {

'a'

,

'b'

,

'c'

, 0x0625,

'1'

, 0};

text1, -1, text2, -1,

&errorCode);

text2[4] = '2';

text2, -1, text1, -1,

&errorCode);

*

@ UBIDI_MIRRORING_OFF

0: Constant indicating that character mirroring should not be performed.

char16_t UChar

The base type for UTF-16 code units and pointers.

#define U_SHAPE_DIGITS_AN2EN

Digit shaping option: Replace Arabic-Indic digits by European digits (U+0030...).

#define U_SHAPE_DIGIT_TYPE_AN_EXTENDED

Digit type option: Use Eastern (Extended) Arabic-Indic digits (U+06f0...U+06f9).

Parameters

This object serves for one-time setup to amortize initialization overheads. Use of this object is not thread-safe. All other threads should allocate a new UBiDiTransform object by calling ubiditransform_open() before using it. Alternatively, a caller can set this parameter to NULL, in which case the object will be allocated by the engine on the fly.

Parameters
src A pointer to the text that the Bidi layout transformations will be performed on.

Note: the text must be (at least) srcLength long.

Parameters
srcLength The length of the text, in number of UChars. If length == -1 then the text must be zero-terminated. dest A pointer to where the processed text is to be copied. destSize The size of the dest buffer, in number of UChars. If the U_SHAPE_LETTERS_UNSHAPE option is set, then the destination length could be as large as srcLength * 2. Otherwise, the destination length will not exceed srcLength. If the caller reserves the last position for zero-termination, it should be excluded from destSize.

destSize == -1 is allowed and makes sense when dest was holds some meaningful value, e.g. that of src. In this case dest must be zero-terminated.

Parameters
inParaLevel A base embedding level of the input as defined in ubidi_setPara documentation for the paraLevel parameter. inOrder An order of the input, which can be one of the UBiDiOrder values. outParaLevel A base embedding level of the output as defined in ubidi_setPara documentation for the paraLevel parameter. outOrder An order of the output, which can be one of the UBiDiOrder values. doMirroring Indicates whether or not to perform character mirroring, and can accept one of the UBiDiMirroring values. shapingOptions Arabic digit and letter shaping options defined in the ushape.h documentation.

Note: Direction indicator options are computed by the transformation engine based on the effective ordering schemes, so user-defined direction indicators will be ignored.

Parameters
pErrorCode A pointer to an error code value.
Returns
The destination length, i.e. the number of UChars written to dest. If the transformation fails, the return value will be 0 (and the error code will be written to pErrorCode).
See also
UBiDiLevel
UBiDiOrder
UBiDiMirroring
ubidi_setPara
u_shapeArabic
Stable:
ICU 58

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4