~ubuntu-branches/ubuntu/gutsy/icu/gutsy-updates

« back to all changes in this revision

Viewing changes to source/common/unicode/urep.h

  • Committer: Package Import Robot
  • Author(s): Jay Berkenbilt
  • Date: 2005-11-19 11:29:31 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20051119112931-vcizkrp10tli4enw
Tags: 3.4-3
Explicitly build with g++ 3.4.  The current ICU fails its test suite
with 4.0 but not with 3.4.  Future versions should work properly with
4.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
******************************************************************************
3
 
*   Copyright (C) 1997-2001, International Business Machines
4
 
*   Corporation and others.  All Rights Reserved.
5
 
******************************************************************************
6
 
*   Date        Name        Description
7
 
*   06/23/00    aliu        Creation.
8
 
******************************************************************************
9
 
*/
10
 
 
11
 
#ifndef __UREP_H
12
 
#define __UREP_H
13
 
 
14
 
#include "unicode/utypes.h"
15
 
 
16
 
U_CDECL_BEGIN
17
 
 
18
 
/********************************************************************
19
 
 * General Notes
20
 
 ********************************************************************
21
 
 * TODO
22
 
 * Add usage scenario
23
 
 * Add test code
24
 
 * Talk about pinning
25
 
 * Talk about "can truncate result if out of memory"
26
 
 */
27
 
 
28
 
/********************************************************************
29
 
 * Data Structures
30
 
 ********************************************************************/
31
 
 
32
 
/**
33
 
 * An opaque replaceable text object.  This will be manipulated only
34
 
 * through the caller-supplied UReplaceableFunctor struct.  Related
35
 
 * to the C++ class Replaceable.
36
 
 * @stable
37
 
 */
38
 
typedef void* UReplaceable;
39
 
 
40
 
/**
41
 
 * A set of function pointers that transliterators use to manipulate a
42
 
 * UReplaceable.  The caller should supply the required functions to
43
 
 * manipulate their text appropriately.  Related to the C++ class
44
 
 * Replaceable.
45
 
 * @stable
46
 
 */
47
 
typedef struct _UReplaceableCallbacks {
48
 
 
49
 
    /**
50
 
     * Function pointer that returns the number of UChar code units in
51
 
     * this text.
52
 
     * @stable
53
 
     */
54
 
    int32_t (*length)(const UReplaceable* rep);
55
 
 
56
 
    /**
57
 
     * Function pointer that returns a UChar code units at the given
58
 
     * offset into this text; 0 <= offset < n, where n is the value
59
 
     * returned by (*length)(rep).  See unistr.h for a description of
60
 
     * charAt() vs. char32At().
61
 
     * @stable
62
 
     */
63
 
    UChar   (*charAt)(const UReplaceable* rep,
64
 
                      int32_t offset);
65
 
 
66
 
    /**
67
 
     * Function pointer that returns a UChar32 code point at the given
68
 
     * offset into this text.  See unistr.h for a description of
69
 
     * charAt() vs. char32At().
70
 
     * @stable
71
 
     */
72
 
    UChar32 (*char32At)(const UReplaceable* rep,
73
 
                        int32_t offset);
74
 
    
75
 
    /**
76
 
     * Function pointer that replaces text between start and limit in
77
 
     * this text with the given text.  Attributes (out of band info)
78
 
     * should be retained.
79
 
     * @param start the starting index of the text to be replaced,
80
 
     * inclusive.
81
 
     * @param limit the ending index of the text to be replaced,
82
 
     * exclusive.
83
 
     * @param text the new text to replace the UChars from
84
 
     * start..limit-1.
85
 
     * @param textLength the number of UChars at text, or -1 if text
86
 
     * is null-terminated.
87
 
     * @stable
88
 
     */
89
 
    void    (*replace)(UReplaceable* rep,
90
 
                       int32_t start,
91
 
                       int32_t limit,
92
 
                       const UChar* text,
93
 
                       int32_t textLength);
94
 
    
95
 
    /**
96
 
     * Function pointer that copies the characters in the range
97
 
     * [<tt>start</tt>, <tt>limit</tt>) into the array <tt>dst</tt>.
98
 
     * @param start offset of first character which will be copied
99
 
     * into the array
100
 
     * @param limit offset immediately following the last character to
101
 
     * be copied
102
 
     * @param dst array in which to copy characters.  The length of
103
 
     * <tt>dst</tt> must be at least <tt>(limit - start)</tt>.
104
 
     * @draft ICU 2.1
105
 
     */
106
 
    void    (*extract)(UReplaceable* rep,
107
 
                       int32_t start,
108
 
                       int32_t limit,
109
 
                       UChar* dst);
110
 
 
111
 
    /**
112
 
     * Function pointer that copies text between start and limit in
113
 
     * this text to another index in the text.  Attributes (out of
114
 
     * band info) should be retained.  After this call, there will be
115
 
     * (at least) two copies of the characters originally located at
116
 
     * start..limit-1.
117
 
     * @param start the starting index of the text to be copied,
118
 
     * inclusive.
119
 
     * @param limit the ending index of the text to be copied,
120
 
     * exclusive.
121
 
     * @param dest the index at which the copy of the UChars should be
122
 
     * inserted.
123
 
     * @stable
124
 
     */
125
 
    void    (*copy)(UReplaceable* rep,
126
 
                    int32_t start,
127
 
                    int32_t limit,
128
 
                    int32_t dest);    
129
 
 
130
 
} UReplaceableCallbacks;
131
 
 
132
 
U_CDECL_END
133
 
 
134
 
#endif