Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 10:11:59

0001 // Protocol Buffers - Google's data interchange format
0002 // Copyright 2008 Google Inc.  All rights reserved.
0003 //
0004 // Use of this source code is governed by a BSD-style
0005 // license that can be found in the LICENSE file or at
0006 // https://developers.google.com/open-source/licenses/bsd
0007 
0008 #ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_LINE_CONSUMER_H__
0009 #define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_LINE_CONSUMER_H__
0010 
0011 #include <string>
0012 
0013 #include "absl/strings/string_view.h"
0014 #include "google/protobuf/io/zero_copy_stream.h"
0015 
0016 // Must be included last
0017 #include "google/protobuf/port_def.inc"
0018 
0019 namespace google {
0020 namespace protobuf {
0021 namespace compiler {
0022 namespace objectivec {
0023 
0024 // TODO: PROTOC_EXPORT is only used to allow the CMake build to
0025 // find/link these in the unittest, this is not public api.
0026 
0027 // Helper for parsing simple files.
0028 class PROTOC_EXPORT LineConsumer {
0029  public:
0030   LineConsumer() = default;
0031   virtual ~LineConsumer() = default;
0032   virtual bool ConsumeLine(absl::string_view line, std::string* out_error) = 0;
0033 };
0034 
0035 bool PROTOC_EXPORT ParseSimpleFile(absl::string_view path,
0036                                    LineConsumer* line_consumer,
0037                                    std::string* out_error);
0038 
0039 bool PROTOC_EXPORT ParseSimpleStream(io::ZeroCopyInputStream& input_stream,
0040                                      absl::string_view stream_name,
0041                                      LineConsumer* line_consumer,
0042                                      std::string* out_error);
0043 
0044 }  // namespace objectivec
0045 }  // namespace compiler
0046 }  // namespace protobuf
0047 }  // namespace google
0048 
0049 #include "google/protobuf/port_undef.inc"
0050 
0051 #endif  // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_LINE_CONSUMER_H__