chromium/third_party/protobuf/src/google/protobuf/util/internal/proto_writer.cc

// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.  All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <google/protobuf/util/internal/proto_writer.h>

#include <cstdint>
#include <functional>
#include <stack>
#include <unordered_set>

#include <google/protobuf/stubs/once.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/stubs/strutil.h>
#include <google/protobuf/stubs/statusor.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/object_location_tracker.h>
#include <google/protobuf/util/internal/utility.h>
#include <google/protobuf/stubs/map_util.h>


// Must be included last.
#include <google/protobuf/port_def.inc>

namespace google {
namespace protobuf {
namespace util {
namespace converter {

CodedOutputStream;
WireFormatLite;

ProtoWriter::ProtoWriter(TypeResolver* type_resolver,
                         const google::protobuf::Type& type,
                         strings::ByteSink* output, ErrorListener* listener)
    :{}

ProtoWriter::ProtoWriter(const TypeInfo* typeinfo,
                         const google::protobuf::Type& type,
                         strings::ByteSink* output, ErrorListener* listener)
    :{}

ProtoWriter::~ProtoWriter() {}

namespace {

// Writes an INT32 field, including tag to the stream.
inline util::Status WriteInt32(int field_number, const DataPiece& data,
                               CodedOutputStream* stream) {}

// writes an SFIXED32 field, including tag, to the stream.
inline util::Status WriteSFixed32(int field_number, const DataPiece& data,
                                  CodedOutputStream* stream) {}

// Writes an SINT32 field, including tag, to the stream.
inline util::Status WriteSInt32(int field_number, const DataPiece& data,
                                CodedOutputStream* stream) {}

// Writes a FIXED32 field, including tag, to the stream.
inline util::Status WriteFixed32(int field_number, const DataPiece& data,
                                 CodedOutputStream* stream) {}

// Writes a UINT32 field, including tag, to the stream.
inline util::Status WriteUInt32(int field_number, const DataPiece& data,
                                CodedOutputStream* stream) {}

// Writes an INT64 field, including tag, to the stream.
inline util::Status WriteInt64(int field_number, const DataPiece& data,
                               CodedOutputStream* stream) {}

// Writes an SFIXED64 field, including tag, to the stream.
inline util::Status WriteSFixed64(int field_number, const DataPiece& data,
                                  CodedOutputStream* stream) {}

// Writes an SINT64 field, including tag, to the stream.
inline util::Status WriteSInt64(int field_number, const DataPiece& data,
                                CodedOutputStream* stream) {}

// Writes a FIXED64 field, including tag, to the stream.
inline util::Status WriteFixed64(int field_number, const DataPiece& data,
                                 CodedOutputStream* stream) {}

// Writes a UINT64 field, including tag, to the stream.
inline util::Status WriteUInt64(int field_number, const DataPiece& data,
                                CodedOutputStream* stream) {}

// Writes a DOUBLE field, including tag, to the stream.
inline util::Status WriteDouble(int field_number, const DataPiece& data,
                                CodedOutputStream* stream) {}

// Writes a FLOAT field, including tag, to the stream.
inline util::Status WriteFloat(int field_number, const DataPiece& data,
                               CodedOutputStream* stream) {}

// Writes a BOOL field, including tag, to the stream.
inline util::Status WriteBool(int field_number, const DataPiece& data,
                              CodedOutputStream* stream) {}

// Writes a BYTES field, including tag, to the stream.
inline util::Status WriteBytes(int field_number, const DataPiece& data,
                               CodedOutputStream* stream) {}

// Writes a STRING field, including tag, to the stream.
inline util::Status WriteString(int field_number, const DataPiece& data,
                                CodedOutputStream* stream) {}

// Given a google::protobuf::Type, returns the set of all required fields.
std::unordered_set<const google::protobuf::Field*> GetRequiredFields(
    const google::protobuf::Type& type) {}

}  // namespace

ProtoWriter::ProtoElement::ProtoElement(const TypeInfo* typeinfo,
                                        const google::protobuf::Type& type,
                                        ProtoWriter* enclosing)
    :{}

ProtoWriter::ProtoElement::ProtoElement(ProtoWriter::ProtoElement* parent,
                                        const google::protobuf::Field* field,
                                        const google::protobuf::Type& type,
                                        bool is_list)
    :{}

ProtoWriter::ProtoElement* ProtoWriter::ProtoElement::pop() {}

void ProtoWriter::ProtoElement::RegisterField(
    const google::protobuf::Field* field) {}

std::string ProtoWriter::ProtoElement::ToString() const {}

bool ProtoWriter::ProtoElement::IsOneofIndexTaken(int32_t index) {}

void ProtoWriter::ProtoElement::TakeOneofIndex(int32_t index) {}

void ProtoWriter::InvalidName(StringPiece unknown_name,
                              StringPiece message) {}

void ProtoWriter::InvalidValue(StringPiece type_name,
                               StringPiece value) {}

void ProtoWriter::MissingField(StringPiece missing_name) {}

ProtoWriter* ProtoWriter::StartObject(
    StringPiece name) {}


ProtoWriter* ProtoWriter::EndObject() {}

ProtoWriter* ProtoWriter::StartList(
    StringPiece name) {}


ProtoWriter* ProtoWriter::EndList() {}

ProtoWriter* ProtoWriter::RenderDataPiece(
    StringPiece name, const DataPiece& data) {}

bool ProtoWriter::ValidOneof(const google::protobuf::Field& field,
                             StringPiece unnormalized_name) {}

bool ProtoWriter::IsRepeated(const google::protobuf::Field& field) {}

ProtoWriter* ProtoWriter::StartObjectField(const google::protobuf::Field& field,
                                           const google::protobuf::Type& type) {}

ProtoWriter* ProtoWriter::StartListField(const google::protobuf::Field& field,
                                         const google::protobuf::Type& type) {}

util::Status ProtoWriter::WriteEnum(int field_number, const DataPiece& data,
                                    const google::protobuf::Enum* enum_type,
                                    CodedOutputStream* stream,
                                    bool use_lower_camel_for_enums,
                                    bool case_insensitive_enum_parsing,
                                    bool ignore_unknown_values) {}

ProtoWriter* ProtoWriter::RenderPrimitiveField(
    const google::protobuf::Field& field, const google::protobuf::Type& type,
    const DataPiece& data) {}

const google::protobuf::Field* ProtoWriter::BeginNamed(StringPiece name,
                                                       bool is_list) {}

const google::protobuf::Field* ProtoWriter::Lookup(
    StringPiece unnormalized_name) {}

const google::protobuf::Type* ProtoWriter::LookupType(
    const google::protobuf::Field* field) {}

void ProtoWriter::WriteRootMessage() {}

void ProtoWriter::WriteTag(const google::protobuf::Field& field) {}


}  // namespace converter
}  // namespace util
}  // namespace protobuf
}  // namespace google