#include "net/tools/huffman_trie/huffman/huffman_builder.h"
#include <algorithm>
#include <ostream>
#include "base/check.h"
namespace net::huffman_trie {
namespace {
class HuffmanNode { … };
bool CompareNodes(const std::unique_ptr<HuffmanNode>& lhs,
const std::unique_ptr<HuffmanNode>& rhs) { … }
}
HuffmanBuilder::HuffmanBuilder() = default;
HuffmanBuilder::~HuffmanBuilder() = default;
void HuffmanBuilder::RecordUsage(uint8_t character) { … }
HuffmanRepresentationTable HuffmanBuilder::ToTable() { … }
void HuffmanBuilder::TreeToTable(HuffmanNode* node,
uint32_t bits,
uint32_t number_of_bits,
HuffmanRepresentationTable* table) { … }
std::vector<uint8_t> HuffmanBuilder::ToVector() { … }
uint32_t HuffmanBuilder::WriteToVector(HuffmanNode* node,
std::vector<uint8_t>* vector) { … }
std::unique_ptr<HuffmanNode> HuffmanBuilder::BuildTree() { … }
}