1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
//! 
//! Byte-position text functions are like their equivalent ordinary text 
//! functions, but manipulate byte positions rather than a count of the number 
//! of characters. Byte positions are integers that may depend on the specific 
//! text representation used by the implementation. Byte positions are by 
//! definition implementation-dependent and reliance upon them reduces 
//! interoperability.
//! 
//! The pseudotypes ByteLength and BytePosition are Integers, but their exact 
//! meanings and values are not further defined by this specification.

use crate::*;
#[allow(unused_imports)]
use crate::textb::*;

/// Returns the starting position of a given text, using byte positions.
///
/// [documentfoundation->FINDB](https://wiki.documentfoundation.org/Documentation/Calc_Functions/FINDB)
///
/// __Syntax__: 
/// ```ods
///     FINDB( Search: Text; T: Text )
/// ```
///
/// __Semantics__:
/// The same as FIND, but using byte positions.
///
/// __See also__: [crate::of::find()], [crate::of::leftb()], [crate::of::rightb()], [crate::of::findb_()], 
#[inline]
pub fn findb<A: Text, B: Text>(search: A, t: B) -> FnNumber2<A, B> {
    FnNumber2("FINDB", search, t)
}

/// Returns the starting position of a given text, using byte positions.
///
/// [documentfoundation->FINDB](https://wiki.documentfoundation.org/Documentation/Calc_Functions/FINDB)
///
/// __Syntax__: 
/// ```ods
///     FINDB( Search: Text; T: Text; Start: BytePosition )
/// ```
///
/// __Semantics__:
/// The same as FIND, but using byte positions.
///
/// __See also__: [crate::of::find()], [crate::of::leftb()], [crate::of::rightb()], [crate::of::findb()], 
#[inline]
pub fn findb_<A: Text, B: Text, C: Number>(search: A, t: B, start: C) -> FnNumber3<A, B, C> {
    FnNumber3("FINDB", search, t, start)
}

/// Returns a selected number of text characters from the left, using a byte 
/// position.
///
/// [documentfoundation->LEFTB](https://wiki.documentfoundation.org/Documentation/Calc_Functions/LEFTB)
///
/// __Syntax__: 
/// ```ods
///     LEFTB( T: Text )
/// ```
///
/// __Semantics__:
/// As LEFT, but using a byte position.
///
/// __See also__: [crate::of::left()], [crate::of::right()], [crate::of::rightb()], [crate::of::leftb_()], 
#[inline]
pub fn leftb<A: Text>(t: A) -> FnText1<A> {
    FnText1("LEFTB", t)
}

/// Returns a selected number of text characters from the left, using a byte 
/// position.
///
/// [documentfoundation->LEFTB](https://wiki.documentfoundation.org/Documentation/Calc_Functions/LEFTB)
///
/// __Syntax__: 
/// ```ods
///     LEFTB( T: Text; Length: ByteLength )
/// ```
///
/// __Semantics__:
/// As LEFT, but using a byte position.
///
/// __See also__: [crate::of::left()], [crate::of::right()], [crate::of::rightb()], [crate::of::leftb()], 
#[inline]
pub fn leftb_<A: Text, B: Number>(t: A, length: B) -> FnText2<A, B> {
    FnText2("LEFTB", t, length)
}

/// Returns the length of given text in units compatible with byte positions
///
/// [documentfoundation->LENB](https://wiki.documentfoundation.org/Documentation/Calc_Functions/LENB)
///
/// __Syntax__: 
/// ```ods
///     LENB( T: Text )
/// ```
///
/// __Constraints__:
/// None.
///
/// __Semantics__:
/// As LEN, but compatible with byte position values.
///
/// __See also__: [crate::of::len()], [crate::of::leftb()], [crate::of::rightb()], 
#[inline]
pub fn lenb<A: Text>(t: A) -> FnNumber1<A> {
    FnNumber1("LENB", t)
}

/// Returns extracted text, given an original text, starting position using a 
/// byte position, and length.
///
/// [documentfoundation->MIDB](https://wiki.documentfoundation.org/Documentation/Calc_Functions/MIDB)
///
/// __Syntax__: 
/// ```ods
///     MIDB( T: Text; Start: BytePosition; Length: ByteLength )
/// ```
///
/// __Constraints__:
/// Length ≥ 0.
///
/// __Semantics__:
/// As MID, but using byte positions.
///
/// __See also__: [crate::of::mid()], [crate::of::leftb()], [crate::of::rightb()], [crate::of::replaceb()], 
#[inline]
pub fn midb<A: Text, B: Number, C: Number>(t: A, start: B, length: C) -> FnText3<A, B, C> {
    FnText3("MIDB", t, start, length)
}

/// Returns text where an old text is replaced with a new text, using byte 
/// positions.
///
/// [documentfoundation->REPLACEB](https://wiki.documentfoundation.org/Documentation/Calc_Functions/REPLACEB)
///
/// __Syntax__: 
/// ```ods
///     REPLACEB( T: Text; Start: BytePosition; Len: ByteLength; New: Text )
/// ```
///
/// __Semantics__:
/// As REPLACE, but using byte positions.
///
/// __See also__: [crate::of::replace()], [crate::of::leftb()], [crate::of::rightb()], [crate::of::midb()], [crate::of::substitute()], 
#[inline]
pub fn replaceb<A: Text, B: Number, C: Number, D: Text>(t: A, start: B, len: C, new: D) -> FnText4<A, B, C, D> {
    FnText4("REPLACEB", t, start, len, new)
}

/// Returns a selected number of text characters from the right, using byte 
/// position.
///
/// [documentfoundation->RIGHTB](https://wiki.documentfoundation.org/Documentation/Calc_Functions/RIGHTB)
///
/// __Syntax__: 
/// ```ods
///     RIGHTB( T: Text )
/// ```
///
/// __Semantics__:
/// As RIGHT, but using byte positions.
///
/// __See also__: [crate::of::right()], [crate::of::leftb()], [crate::of::rightb_()], 
#[inline]
pub fn rightb<A: Text>(t: A) -> FnText1<A> {
    FnText1("RIGHTB", t)
}

/// Returns a selected number of text characters from the right, using byte 
/// position.
///
/// [documentfoundation->RIGHTB](https://wiki.documentfoundation.org/Documentation/Calc_Functions/RIGHTB)
///
/// __Syntax__: 
/// ```ods
///     RIGHTB( T: Text; Length: ByteLength )
/// ```
///
/// __Semantics__:
/// As RIGHT, but using byte positions.
///
/// __See also__: [crate::of::right()], [crate::of::leftb()], [crate::of::rightb()], 
#[inline]
pub fn rightb_<A: Text, B: Number>(t: A, length: B) -> FnText2<A, B> {
    FnText2("RIGHTB", t, length)
}

/// Returns the starting position of a given text, using byte positions.
///
/// [documentfoundation->SEARCHB](https://wiki.documentfoundation.org/Documentation/Calc_Functions/SEARCHB)
///
/// __Syntax__: 
/// ```ods
///     SEARCHB( Search: Text; T: Text )
/// ```
///
/// __Semantics__:
/// As SEARCH, but using byte positions.
///
/// __See also__: [crate::of::search()], [crate::of::exact()], [crate::of::find()], [crate::of::findb()], [crate::of::searchb_()], 
#[inline]
pub fn searchb<A: Text, B: Text>(search: A, t: B) -> FnNumber2<A, B> {
    FnNumber2("SEARCHB", search, t)
}

/// Returns the starting position of a given text, using byte positions.
///
/// [documentfoundation->SEARCHB](https://wiki.documentfoundation.org/Documentation/Calc_Functions/SEARCHB)
///
/// __Syntax__: 
/// ```ods
///     SEARCHB( Search: Text; T: Text; Start: BytePosition )
/// ```
///
/// __Semantics__:
/// As SEARCH, but using byte positions.
///
/// __See also__: [crate::of::search()], [crate::of::exact()], [crate::of::find()], [crate::of::findb()], [crate::of::searchb()], 
#[inline]
pub fn searchb_<A: Text, B: Text, C: Number>(search: A, t: B, start: C) -> FnNumber3<A, B, C> {
    FnNumber3("SEARCHB", search, t, start)
}