#include <google/protobuf/util/internal/protostream_objectsource.h>
#include <cstdint>
#include <unordered_map>
#include <utility>
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/stubs/once.h>
#include <google/protobuf/unknown_field_set.h>
#include <google/protobuf/wire_format.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/stubs/strutil.h>
#include <google/protobuf/stubs/casts.h>
#include <google/protobuf/stubs/status.h>
#include <google/protobuf/stubs/stringprintf.h>
#include <google/protobuf/stubs/time.h>
#include <google/protobuf/util/internal/constants.h>
#include <google/protobuf/util/internal/field_mask_utility.h>
#include <google/protobuf/util/internal/utility.h>
#include <google/protobuf/stubs/map_util.h>
#include <google/protobuf/stubs/status_macros.h>
#include <google/protobuf/port_def.inc>
namespace google {
namespace protobuf {
namespace util {
namespace converter {
WireFormat;
WireFormatLite;
namespace {
static int kDefaultMaxRecursionDepth = …;
const google::protobuf::Field* FindFieldByNumber(
const google::protobuf::Type& type, int number);
bool IsPackable(const google::protobuf::Field& field);
const google::protobuf::EnumValue* FindEnumValueByNumber(
const google::protobuf::Enum& tech_enum, int number);
const std::string FormatNanos(uint32_t nanos, bool with_trailing_zeros);
util::StatusOr<std::string> MapKeyDefaultValueAsString(
const google::protobuf::Field& field) { … }
}
ProtoStreamObjectSource::ProtoStreamObjectSource(
io::CodedInputStream* stream, TypeResolver* type_resolver,
const google::protobuf::Type& type, const RenderOptions& render_options)
: … { … }
ProtoStreamObjectSource::ProtoStreamObjectSource(
io::CodedInputStream* stream, const TypeInfo* typeinfo,
const google::protobuf::Type& type, const RenderOptions& render_options)
: … { … }
ProtoStreamObjectSource::~ProtoStreamObjectSource() { … }
util::Status ProtoStreamObjectSource::NamedWriteTo(StringPiece name,
ObjectWriter* ow) const { … }
const google::protobuf::Field* ProtoStreamObjectSource::FindAndVerifyField(
const google::protobuf::Type& type, uint32_t tag) const { … }
util::Status ProtoStreamObjectSource::WriteMessage(
const google::protobuf::Type& type, StringPiece name,
const uint32_t end_tag, bool include_start_and_end,
ObjectWriter* ow) const { … }
util::StatusOr<uint32_t> ProtoStreamObjectSource::RenderList(
const google::protobuf::Field* field, StringPiece name,
uint32_t list_tag, ObjectWriter* ow) const { … }
util::StatusOr<uint32_t> ProtoStreamObjectSource::RenderMap(
const google::protobuf::Field* field, StringPiece ,
uint32_t list_tag, ObjectWriter* ow) const { … }
util::Status ProtoStreamObjectSource::RenderPacked(
const google::protobuf::Field* field, ObjectWriter* ow) const { … }
util::Status ProtoStreamObjectSource::RenderTimestamp(
const ProtoStreamObjectSource* os, const google::protobuf::Type& type,
StringPiece field_name, ObjectWriter* ow) { … }
util::Status ProtoStreamObjectSource::RenderDuration(
const ProtoStreamObjectSource* os, const google::protobuf::Type& type,
StringPiece field_name, ObjectWriter* ow) { … }
util::Status ProtoStreamObjectSource::RenderDouble(
const ProtoStreamObjectSource* os, const google::protobuf::Type& ,
StringPiece field_name, ObjectWriter* ow) { … }
util::Status ProtoStreamObjectSource::RenderFloat(
const ProtoStreamObjectSource* os, const google::protobuf::Type& ,
StringPiece field_name, ObjectWriter* ow) { … }
util::Status ProtoStreamObjectSource::RenderInt64(
const ProtoStreamObjectSource* os, const google::protobuf::Type& ,
StringPiece field_name, ObjectWriter* ow) { … }
util::Status ProtoStreamObjectSource::RenderUInt64(
const ProtoStreamObjectSource* os, const google::protobuf::Type& ,
StringPiece field_name, ObjectWriter* ow) { … }
util::Status ProtoStreamObjectSource::RenderInt32(
const ProtoStreamObjectSource* os, const google::protobuf::Type& ,
StringPiece field_name, ObjectWriter* ow) { … }
util::Status ProtoStreamObjectSource::RenderUInt32(
const ProtoStreamObjectSource* os, const google::protobuf::Type& ,
StringPiece field_name, ObjectWriter* ow) { … }
util::Status ProtoStreamObjectSource::RenderBool(
const ProtoStreamObjectSource* os, const google::protobuf::Type& ,
StringPiece field_name, ObjectWriter* ow) { … }
util::Status ProtoStreamObjectSource::RenderString(
const ProtoStreamObjectSource* os, const google::protobuf::Type& ,
StringPiece field_name, ObjectWriter* ow) { … }
util::Status ProtoStreamObjectSource::RenderBytes(
const ProtoStreamObjectSource* os, const google::protobuf::Type& ,
StringPiece field_name, ObjectWriter* ow) { … }
util::Status ProtoStreamObjectSource::RenderStruct(
const ProtoStreamObjectSource* os, const google::protobuf::Type& type,
StringPiece field_name, ObjectWriter* ow) { … }
util::Status ProtoStreamObjectSource::RenderStructValue(
const ProtoStreamObjectSource* os, const google::protobuf::Type& type,
StringPiece field_name, ObjectWriter* ow) { … }
util::Status ProtoStreamObjectSource::RenderStructListValue(
const ProtoStreamObjectSource* os, const google::protobuf::Type& type,
StringPiece field_name, ObjectWriter* ow) { … }
util::Status ProtoStreamObjectSource::RenderAny(
const ProtoStreamObjectSource* os, const google::protobuf::Type& type,
StringPiece field_name, ObjectWriter* ow) { … }
util::Status ProtoStreamObjectSource::RenderFieldMask(
const ProtoStreamObjectSource* os, const google::protobuf::Type& type,
StringPiece field_name, ObjectWriter* ow) { … }
std::unordered_map<std::string, ProtoStreamObjectSource::TypeRenderer>*
ProtoStreamObjectSource::renderers_ = …;
PROTOBUF_NAMESPACE_ID::internal::once_flag source_renderers_init_;
void ProtoStreamObjectSource::InitRendererMap() { … }
void ProtoStreamObjectSource::DeleteRendererMap() { … }
ProtoStreamObjectSource::TypeRenderer*
ProtoStreamObjectSource::FindTypeRenderer(const std::string& type_url) { … }
util::Status ProtoStreamObjectSource::RenderField(
const google::protobuf::Field* field, StringPiece field_name,
ObjectWriter* ow) const { … }
util::Status ProtoStreamObjectSource::RenderNonMessageField(
const google::protobuf::Field* field, StringPiece field_name,
ObjectWriter* ow) const { … }
const std::string ProtoStreamObjectSource::ReadFieldValueAsString(
const google::protobuf::Field& field) const { … }
bool ProtoStreamObjectSource::IsMap(
const google::protobuf::Field& field) const { … }
std::pair<int64_t, int32_t> ProtoStreamObjectSource::ReadSecondsAndNanos(
const google::protobuf::Type& type) const { … }
util::Status ProtoStreamObjectSource::IncrementRecursionDepth(
StringPiece type_name, StringPiece field_name) const { … }
namespace {
const google::protobuf::Field* FindFieldByNumber(
const google::protobuf::Type& type, int number) { … }
bool IsPackable(const google::protobuf::Field& field) { … }
const google::protobuf::EnumValue* FindEnumValueByNumber(
const google::protobuf::Enum& tech_enum, int number) { … }
const std::string FormatNanos(uint32_t nanos, bool with_trailing_zeros) { … }
}
}
}
}
}