#include <algorithm>
#include <vector>
#include "base/check_op.h"
#include "base/numerics/safe_math.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
#include "components/safe_browsing/core/browser/db/v4_rice.h"
#if BUILDFLAG(IS_WIN)
#include <winsock2.h>
#elif BUILDFLAG(IS_POSIX)
#include <arpa/inet.h>
#endif
int32;
int64;
RepeatedField;
#if !defined(ARCH_CPU_LITTLE_ENDIAN) || (ARCH_CPU_LITTLE_ENDIAN != 1)
#error The code below assumes little-endianness.
#endif
namespace safe_browsing {
namespace {
const int kBitsPerByte = …;
const unsigned int kMaxBitIndex = …;
}
V4DecodeResult V4RiceDecoder::ValidateInput(const int32 rice_parameter,
const int32 num_entries,
const std::string& encoded_data) { … }
V4DecodeResult V4RiceDecoder::DecodeIntegers(const int64 first_value,
const int32 rice_parameter,
const int32 num_entries,
const std::string& encoded_data,
RepeatedField<int32>* out) { … }
V4DecodeResult V4RiceDecoder::DecodePrefixes(const int64 first_value,
const int32 rice_parameter,
const int32 num_entries,
const std::string& encoded_data,
std::vector<uint32_t>* out) { … }
V4RiceDecoder::V4RiceDecoder(const int rice_parameter,
const int num_entries,
const std::string& encoded_data)
: … { … }
V4RiceDecoder::~V4RiceDecoder() { … }
bool V4RiceDecoder::HasAnotherValue() const { … }
V4DecodeResult V4RiceDecoder::GetNextValue(uint32_t* value) { … }
V4DecodeResult V4RiceDecoder::GetNextWord(uint32_t* word) { … }
V4DecodeResult V4RiceDecoder::GetNextBits(unsigned int num_requested_bits,
uint32_t* x) { … }
uint32_t V4RiceDecoder::GetBitsFromCurrentWord(
unsigned int num_requested_bits) { … }
std::string V4RiceDecoder::DebugString() const { … }
std::ostream& operator<<(std::ostream& os, const V4RiceDecoder& rice_decoder) { … }
}