chromium/third_party/hunspell/google/bdict_reader.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// Like the "Visitor" design pattern, this lightweight object provides an
// interface around a serialized trie node at the given address in the memory.
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 {}

// WordIterator ----------------------------------------------------------------

struct WordIterator::NodeInfo {};

WordIterator::WordIterator(const NodeReader& reader) {}

WordIterator::WordIterator(const WordIterator& other) = default;

// Can't be in the header for the NodeReader destructor.
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::LineIterator(base::span<const unsigned char> bdict_data,
                           size_t first_offset)
    :{}

// Returns true when all data has been read. We're done when we reach a
// double-NULL or a the end of the input (shouldn't happen).
bool LineIterator::IsDone() const {}

const char* LineIterator::Advance() {}

// ReplacementIterator ---------------------------------------------------------

// Fills pointers to NULL terminated strings into the given output params.
// Returns false if there are no more pairs and nothing was filled in.
bool ReplacementIterator::GetNext(const char** first, const char** second) {}

// BDictReader -----------------------------------------------------------------

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 {}

}  // namespace hunspell