|
|
@ -36,24 +36,30 @@ |
|
|
|
|
|
|
|
|
|
|
|
#include "google/protobuf/io/zero_copy_stream.h" |
|
|
|
#include "google/protobuf/io/zero_copy_stream.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Must be included last
|
|
|
|
|
|
|
|
#include "google/protobuf/port_def.inc" |
|
|
|
|
|
|
|
|
|
|
|
namespace google { |
|
|
|
namespace google { |
|
|
|
namespace protobuf { |
|
|
|
namespace protobuf { |
|
|
|
namespace compiler { |
|
|
|
namespace compiler { |
|
|
|
namespace objectivec { |
|
|
|
namespace objectivec { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO(b/250947994): PROTOC_EXPORT is only used to allow the CMake build to
|
|
|
|
|
|
|
|
// find/link these in the unittest, this is not public api.
|
|
|
|
|
|
|
|
|
|
|
|
// Helper for parsing simple files.
|
|
|
|
// Helper for parsing simple files.
|
|
|
|
class LineConsumer { |
|
|
|
class PROTOC_EXPORT LineConsumer { |
|
|
|
public: |
|
|
|
public: |
|
|
|
LineConsumer(); |
|
|
|
LineConsumer(); |
|
|
|
virtual ~LineConsumer(); |
|
|
|
virtual ~LineConsumer(); |
|
|
|
virtual bool ConsumeLine(const absl::string_view& line, std::string* out_error) = 0; |
|
|
|
virtual bool ConsumeLine(const absl::string_view& line, std::string* out_error) = 0; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
bool ParseSimpleFile(const std::string& path, |
|
|
|
bool PROTOC_EXPORT ParseSimpleFile(const std::string& path, |
|
|
|
LineConsumer* line_consumer, |
|
|
|
LineConsumer* line_consumer, |
|
|
|
std::string* out_error); |
|
|
|
std::string* out_error); |
|
|
|
|
|
|
|
|
|
|
|
bool ParseSimpleStream(io::ZeroCopyInputStream& input_stream, |
|
|
|
bool PROTOC_EXPORT ParseSimpleStream(io::ZeroCopyInputStream& input_stream, |
|
|
|
const std::string& stream_name, |
|
|
|
const std::string& stream_name, |
|
|
|
LineConsumer* line_consumer, |
|
|
|
LineConsumer* line_consumer, |
|
|
|
std::string* out_error); |
|
|
|
std::string* out_error); |
|
|
@ -63,4 +69,6 @@ bool ParseSimpleStream(io::ZeroCopyInputStream& input_stream, |
|
|
|
} // namespace protobuf
|
|
|
|
} // namespace protobuf
|
|
|
|
} // namespace google
|
|
|
|
} // namespace google
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "google/protobuf/port_undef.inc" |
|
|
|
|
|
|
|
|
|
|
|
#endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_LINE_CONSUMER_H__
|
|
|
|
#endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_LINE_CONSUMER_H__
|
|
|
|