| 1 |
#ifndef ICU4XLineBreakIteratorLatin1_HPP |
| 2 |
#define ICU4XLineBreakIteratorLatin1_HPP |
| 3 |
#include <stdint.h> |
| 4 |
#include <stddef.h> |
| 5 |
#include <stdbool.h> |
| 6 |
#include <algorithm> |
| 7 |
#include <memory> |
| 8 |
#include <variant> |
| 9 |
#include <optional> |
| 10 |
#include "diplomat_runtime.hpp" |
| 11 |
|
| 12 |
#include "ICU4XLineBreakIteratorLatin1.h" |
| 13 |
|
| 14 |
|
| 15 |
/** |
| 16 |
* A destruction policy for using ICU4XLineBreakIteratorLatin1 with std::unique_ptr. |
| 17 |
*/ |
| 18 |
struct ICU4XLineBreakIteratorLatin1Deleter { |
| 19 |
void operator()(capi::ICU4XLineBreakIteratorLatin1* l) const noexcept { |
| 20 |
capi::ICU4XLineBreakIteratorLatin1_destroy(l); |
| 21 |
} |
| 22 |
}; |
| 23 |
|
| 24 |
/** |
| 25 |
* See the [Rust documentation for `LineBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakIterator.html) for more information. |
| 26 |
* |
| 27 |
* Additional information: [1](https://docs.rs/icu/latest/icu/segmenter/type.LineBreakIteratorLatin1.html) |
| 28 |
*/ |
| 29 |
class ICU4XLineBreakIteratorLatin1 { |
| 30 |
public: |
| 31 |
|
| 32 |
/** |
| 33 |
* Finds the next breakpoint. Returns -1 if at the end of the string or if the index is |
| 34 |
* out of range of a 32-bit signed integer. |
| 35 |
* |
| 36 |
* See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakIterator.html#method.next) for more information. |
| 37 |
*/ |
| 38 |
int32_t next(); |
| 39 |
inline const capi::ICU4XLineBreakIteratorLatin1* AsFFI() const { return this->inner.get(); } |
| 40 |
inline capi::ICU4XLineBreakIteratorLatin1* AsFFIMut() { return this->inner.get(); } |
| 41 |
inline explicit ICU4XLineBreakIteratorLatin1(capi::ICU4XLineBreakIteratorLatin1* i) : inner(i) {} |
| 42 |
ICU4XLineBreakIteratorLatin1() = default; |
| 43 |
ICU4XLineBreakIteratorLatin1(ICU4XLineBreakIteratorLatin1&&) noexcept = default; |
| 44 |
ICU4XLineBreakIteratorLatin1& operator=(ICU4XLineBreakIteratorLatin1&& other) noexcept = default; |
| 45 |
private: |
| 46 |
std::unique_ptr<capi::ICU4XLineBreakIteratorLatin1, ICU4XLineBreakIteratorLatin1Deleter> inner; |
| 47 |
}; |
| 48 |
|
| 49 |
|
| 50 |
inline int32_t ICU4XLineBreakIteratorLatin1::next() { |
| 51 |
return capi::ICU4XLineBreakIteratorLatin1_next(this->inner.get()); |
| 52 |
} |
| 53 |
#endif |