50
50
/* *
51
51
* @brief Defines the bloom filter width based on the size of LONG_BIT.
52
52
*
53
- * This macro sets the value of STRINGLIB_BLOOM_WIDTH depending on the
53
+ * This macro sets the value of ` STRINGLIB_BLOOM_WIDTH` depending on the
54
54
* size of the system's LONG_BIT. It ensures that the bloom filter
55
55
* width is at least 32 bits.
56
56
*
57
57
* @error If LONG_BIT is smaller than 32, a compilation error will occur.
58
58
*/
59
59
#if LONG_BIT >= 128
60
- /* *
61
- * @brief Bloom filter width is set to 128 bits.
62
- */
63
60
#define STRINGLIB_BLOOM_WIDTH 128
64
61
#elif LONG_BIT >= 64
65
- /* *
66
- * @brief Bloom filter width is set to 64 bits.
67
- */
68
62
#define STRINGLIB_BLOOM_WIDTH 64
69
63
#elif LONG_BIT >= 32
70
- /* *
71
- * @brief Bloom filter width is set to 32 bits.
72
- */
73
64
#define STRINGLIB_BLOOM_WIDTH 32
74
65
#else
75
- /* *
76
- * @brief Compilation error for unsupported LONG_BIT sizes.
77
- */
78
66
#error "LONG_BIT is smaller than 32"
79
67
#endif
80
68
@@ -153,7 +141,8 @@ struct CheckedIndexer {
153
141
*
154
142
* @return The first character in the buffer.
155
143
*/
156
- char_type operator *()
144
+ char_type
145
+ operator *()
157
146
{
158
147
return *(this ->buffer );
159
148
}
@@ -166,7 +155,8 @@ struct CheckedIndexer {
166
155
* @param index Index to access in the buffer.
167
156
* @return The character at the specified index or 0 if out of bounds.
168
157
*/
169
- char_type operator [](size_t index)
158
+ char_type
159
+ operator [](size_t index)
170
160
{
171
161
if (index >= this ->length ) {
172
162
return (char_type) 0 ;
@@ -183,7 +173,8 @@ struct CheckedIndexer {
183
173
* @note If the specified number of elements to move exceeds the length of the buffer,
184
174
* the indexer will be moved to the end of the buffer, and the length will be set to 0.
185
175
*/
186
- CheckedIndexer<char_type> operator +(size_t rhs)
176
+ CheckedIndexer<char_type>
177
+ operator +(size_t rhs)
187
178
{
188
179
if (rhs > this ->length ) {
189
180
rhs = this ->length ;
@@ -200,7 +191,8 @@ struct CheckedIndexer {
200
191
* @note If the specified number of elements to move exceeds the length of the buffer,
201
192
* the indexer will be moved to the end of the buffer, and the length will be set to 0.
202
193
*/
203
- CheckedIndexer<char_type>& operator +=(size_t rhs)
194
+ CheckedIndexer<char_type>&
195
+ operator +=(size_t rhs)
204
196
{
205
197
if (rhs > this ->length ) {
206
198
rhs = this ->length ;
@@ -217,7 +209,8 @@ struct CheckedIndexer {
217
209
*
218
210
* @note If the indexer is at the end of the buffer, this operation has no effect.
219
211
*/
220
- CheckedIndexer<char_type> operator ++(int )
212
+ CheckedIndexer<char_type>
213
+ operator ++(int )
221
214
{
222
215
*this += 1 ;
223
216
return *this ;
@@ -231,7 +224,8 @@ struct CheckedIndexer {
231
224
*
232
225
* @note If the indexer moves backward past the start of the buffer, the behavior is undefined.
233
226
*/
234
- CheckedIndexer<char_type>& operator -=(size_t rhs)
227
+ CheckedIndexer<char_type>&
228
+ operator -=(size_t rhs)
235
229
{
236
230
this ->buffer -= rhs;
237
231
this ->length += rhs;
@@ -245,7 +239,8 @@ struct CheckedIndexer {
245
239
*
246
240
* @note If the indexer moves backward past the start of the buffer, the behavior is undefined.
247
241
*/
248
- CheckedIndexer<char_type> operator --(int )
242
+ CheckedIndexer<char_type>
243
+ operator --(int )
249
244
{
250
245
*this -= 1 ;
251
246
return *this ;
@@ -257,7 +252,8 @@ struct CheckedIndexer {
257
252
* @param rhs Another CheckedIndexer instance to compare.
258
253
* @return The difference in pointers between the two indexers.
259
254
*/
260
- std::ptrdiff_t operator -(CheckedIndexer<char_type> rhs)
255
+ std::ptrdiff_t
256
+ operator -(CheckedIndexer<char_type> rhs)
261
257
{
262
258
return this ->buffer - rhs.buffer ;
263
259
}
@@ -270,7 +266,8 @@ struct CheckedIndexer {
270
266
*
271
267
* @note If the indexer moves backward past the start of the buffer, the behavior is undefined.
272
268
*/
273
- CheckedIndexer<char_type> operator -(size_t rhs)
269
+ CheckedIndexer<char_type>
270
+ operator -(size_t rhs)
274
271
{
275
272
return CheckedIndexer (this ->buffer - rhs, this ->length + rhs);
276
273
}
@@ -281,7 +278,8 @@ struct CheckedIndexer {
281
278
* @param rhs Another CheckedIndexer instance to compare.
282
279
* @return True if this indexer is greater than the right-hand side, otherwise false.
283
280
*/
284
- int operator >(CheckedIndexer<char_type> rhs)
281
+ int
282
+ operator >(CheckedIndexer<char_type> rhs)
285
283
{
286
284
return this ->buffer > rhs.buffer ;
287
285
}
@@ -292,7 +290,8 @@ struct CheckedIndexer {
292
290
* @param rhs Another CheckedIndexer instance to compare.
293
291
* @return True if this indexer is greater than or equal to the right-hand side, otherwise false.
294
292
*/
295
- int operator >=(CheckedIndexer<char_type> rhs)
293
+ int
294
+ operator >=(CheckedIndexer<char_type> rhs)
296
295
{
297
296
return this ->buffer >= rhs.buffer ;
298
297
}
@@ -303,7 +302,8 @@ struct CheckedIndexer {
303
302
* @param rhs Another CheckedIndexer instance to compare.
304
303
* @return True if this indexer is less than the right-hand side, otherwise false.
305
304
*/
306
- int operator <(CheckedIndexer<char_type> rhs)
305
+ int
306
+ operator <(CheckedIndexer<char_type> rhs)
307
307
{
308
308
return this ->buffer < rhs.buffer ;
309
309
}
@@ -314,7 +314,8 @@ struct CheckedIndexer {
314
314
* @param rhs Another CheckedIndexer instance to compare.
315
315
* @return True if this indexer is less than or equal to the right-hand side, otherwise false.
316
316
*/
317
- int operator <=(CheckedIndexer<char_type> rhs)
317
+ int
318
+ operator <=(CheckedIndexer<char_type> rhs)
318
319
{
319
320
return this ->buffer <= rhs.buffer ;
320
321
}
@@ -325,7 +326,8 @@ struct CheckedIndexer {
325
326
* @param rhs Another CheckedIndexer instance to compare.
326
327
* @return True if both indexers point to the same buffer, otherwise false.
327
328
*/
328
- int operator ==(CheckedIndexer<char_type> rhs)
329
+ int
330
+ operator ==(CheckedIndexer<char_type> rhs)
329
331
{
330
332
return this ->buffer == rhs.buffer ;
331
333
}
0 commit comments