#include "base/i18n/break_iterator.h"
#include <stdint.h>
#include <ostream>
#include <string_view>
#include "base/check.h"
#include "base/lazy_instance.h"
#include "base/memory/raw_ptr.h"
#include "base/notreached.h"
#include "base/synchronization/lock.h"
#include "third_party/icu/source/common/unicode/ubrk.h"
#include "third_party/icu/source/common/unicode/uchar.h"
#include "third_party/icu/source/common/unicode/ustring.h"
namespace base {
namespace i18n {
namespace {
template <UBreakIteratorType break_type>
class DefaultLocaleBreakIteratorCache { … };
static LazyInstance<DefaultLocaleBreakIteratorCache<UBRK_CHARACTER>>::Leaky
char_break_cache = …;
static LazyInstance<DefaultLocaleBreakIteratorCache<UBRK_WORD>>::Leaky
word_break_cache = …;
static LazyInstance<DefaultLocaleBreakIteratorCache<UBRK_SENTENCE>>::Leaky
sentence_break_cache = …;
static LazyInstance<DefaultLocaleBreakIteratorCache<UBRK_LINE>>::Leaky
line_break_cache = …;
}
void UBreakIteratorDeleter::operator()(UBreakIterator* ptr) { … }
BreakIterator::BreakIterator(std::u16string_view str, BreakType break_type)
: … { … }
BreakIterator::BreakIterator(std::u16string_view str,
const std::u16string& rules)
: … { … }
BreakIterator::~BreakIterator() { … }
bool BreakIterator::Init() { … }
bool BreakIterator::Advance() { … }
bool BreakIterator::SetText(std::u16string_view text) { … }
bool BreakIterator::IsWord() const { … }
BreakIterator::WordBreakStatus BreakIterator::GetWordBreakStatus() const { … }
bool BreakIterator::IsEndOfWord(size_t position) const { … }
bool BreakIterator::IsStartOfWord(size_t position) const { … }
bool BreakIterator::IsSentenceBoundary(size_t position) const { … }
bool BreakIterator::IsGraphemeBoundary(size_t position) const { … }
std::u16string BreakIterator::GetString() const { … }
std::u16string_view BreakIterator::GetStringView() const { … }
}
}