tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

protobuf_utils.h (1422B)


      1 /*
      2 *  Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
      3 *
      4 *  Use of this source code is governed by a BSD-style license
      5 *  that can be found in the LICENSE file in the root of the source
      6 *  tree. An additional intellectual property rights grant can be found
      7 *  in the file PATENTS.  All contributing project authors may
      8 *  be found in the AUTHORS file in the root of the source tree.
      9 */
     10 
     11 #ifndef MODULES_AUDIO_PROCESSING_TEST_PROTOBUF_UTILS_H_
     12 #define MODULES_AUDIO_PROCESSING_TEST_PROTOBUF_UTILS_H_
     13 
     14 #include <cstddef>
     15 #include <cstdint>
     16 #include <cstdio>
     17 #include <memory>
     18 #include <sstream>  // no-presubmit-check TODO(webrtc:8982)
     19 
     20 #include "rtc_base/protobuf_utils.h"
     21 
     22 // Generated at build-time by the protobuf compiler.
     23 #include "modules/audio_processing/debug.pb.h"  // IWYU pragma: export
     24 
     25 namespace webrtc {
     26 
     27 // Allocates new memory in the unique_ptr to fit the raw message and returns the
     28 // number of bytes read.
     29 size_t ReadMessageBytesFromFile(FILE* file, std::unique_ptr<uint8_t[]>* bytes);
     30 
     31 // Returns true on success, false on error or end-of-file.
     32 bool ReadMessageFromFile(FILE* file, MessageLite* msg);
     33 
     34 // Returns true on success, false on error or end of string stream.
     35 bool ReadMessageFromString(
     36    std::stringstream* input,  // no-presubmit-check TODO(webrtc:8982)
     37    MessageLite* msg);
     38 
     39 }  // namespace webrtc
     40 
     41 #endif  // MODULES_AUDIO_PROCESSING_TEST_PROTOBUF_UTILS_H_