#include "third_party/hunspell/google/bdict_reader.h"
#include <stdint.h>
#include <cstdint>
#include <cstring>
#include "base/check.h"
#include "base/compiler_specific.h"
#include "base/numerics/byte_conversions.h"
namespace hunspell {
class NodeReader { … };
NodeReader::NodeReader() : … { … }
NodeReader::NodeReader(base::span<const unsigned char> bdict_data,
size_t node_offset,
int node_depth)
: … { … }
int NodeReader::FindWord(const unsigned char* word,
int affix_indices[BDict::MAX_AFFIXES_PER_WORD]) const { … }
NodeReader::FindResult NodeReader::GetChildAt(int index, char* found_char,
NodeReader* result) const { … }
int NodeReader::CompareLeafNode(
const unsigned char* word,
int affix_indices[BDict::MAX_AFFIXES_PER_WORD]) const { … }
int NodeReader::FillAffixesForLeafMatch(
size_t additional_bytes,
int affix_indices[BDict::MAX_AFFIXES_PER_WORD]) const { … }
int NodeReader::FindInLookup(
const unsigned char* word,
int affix_indices[BDict::MAX_AFFIXES_PER_WORD]) const { … }
NodeReader::FindResult NodeReader::ReaderForLookup0th(
NodeReader* result) const { … }
NodeReader::FindResult NodeReader::ReaderForLookupAt(
size_t index,
char* found_char,
NodeReader* result) const { … }
int NodeReader::FindInList(
const unsigned char* word,
int affix_indices[BDict::MAX_AFFIXES_PER_WORD]) const { … }
NodeReader::FindResult NodeReader::ReaderForListAt(
size_t index,
char* found_char,
NodeReader* result) const { … }
struct WordIterator::NodeInfo { … };
WordIterator::WordIterator(const NodeReader& reader) { … }
WordIterator::WordIterator(const WordIterator& other) = default;
WordIterator::~WordIterator() = default;
WordIterator& WordIterator::operator=(const WordIterator& other) = default;
int WordIterator::Advance(char* output_buffer, size_t output_len,
int affix_ids[BDict::MAX_AFFIXES_PER_WORD]) { … }
int WordIterator::FoundLeaf(const NodeReader& reader, char cur_char,
char* output_buffer, size_t output_len,
int affix_ids[BDict::MAX_AFFIXES_PER_WORD]) { … }
LineIterator::LineIterator() : … { … }
LineIterator::LineIterator(base::span<const unsigned char> bdict_data,
size_t first_offset)
: … { … }
bool LineIterator::IsDone() const { … }
const char* LineIterator::Advance() { … }
bool ReplacementIterator::GetNext(const char** first, const char** second) { … }
BDictReader::BDictReader() = default;
bool BDictReader::Init(base::span<const unsigned char> bdict_data) { … }
int BDictReader::FindWord(
const char* word,
int affix_indices[BDict::MAX_AFFIXES_PER_WORD]) const { … }
LineIterator BDictReader::GetAfLineIterator() const { … }
LineIterator BDictReader::GetAffixLineIterator() const { … }
LineIterator BDictReader::GetOtherLineIterator() const { … }
ReplacementIterator BDictReader::GetReplacementIterator() const { … }
WordIterator BDictReader::GetAllWordIterator() const { … }
}