#ifndef V8_BASE_VLQ_H_
#define V8_BASE_VLQ_H_
#include <limits>
#include <vector>
#include "src/base/memory.h"
namespace v8 {
namespace base {
static constexpr uint32_t kContinueShift = …;
static constexpr uint32_t kContinueBit = …;
static constexpr uint32_t kDataMask = …;
template <typename Function>
inline void VLQEncodeUnsigned(Function&& process_byte, uint32_t value) { … }
inline uint32_t VLQConvertToUnsigned(int32_t value) { … }
template <typename Function>
inline void VLQEncode(Function&& process_byte, int32_t value) { … }
template <typename A>
inline void VLQEncode(std::vector<uint8_t, A>* data, int32_t value) { … }
template <typename A>
inline void VLQEncodeUnsigned(std::vector<uint8_t, A>* data, uint32_t value) { … }
template <typename GetNextFunction>
inline typename std::enable_if<
std::is_same<decltype(std::declval<GetNextFunction>()()), uint8_t>::value,
uint32_t>::type
VLQDecodeUnsigned(GetNextFunction&& get_next) { … }
inline uint32_t VLQDecodeUnsigned(const uint8_t* data_start, int* index) { … }
inline int32_t VLQDecode(const uint8_t* data_start, int* index) { … }
}
}
#endif