/* * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #include "logging/rtc_event_log/encoder/var_int.h" #include <cstddef> #include <cstdint> #include <string> #include <utility> #include "absl/strings/string_view.h" #include "rtc_base/bitstream_reader.h" #include "rtc_base/checks.h" // TODO(eladalon): Add unit tests. namespace webrtc { const size_t kMaxVarIntLengthBytes = …; // ceil(64 / 7.0) is 10. std::string EncodeVarInt(uint64_t input) { … } // There is some code duplication between the flavors of this function. // For performance's sake, it's best to just keep it. std::pair<bool, absl::string_view> DecodeVarInt(absl::string_view input, uint64_t* output) { … } // There is some code duplication between the flavors of this function. // For performance's sake, it's best to just keep it. uint64_t DecodeVarInt(BitstreamReader& input) { … } } // namespace webrtc