chromium/third_party/protobuf/src/google/protobuf/compiler/cpp/file.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.

// Author: [email protected] (Kenton Varda)
//  Based on original Protocol Buffers design by
//  Sanjay Ghemawat, Jeff Dean, and others.

#include <google/protobuf/compiler/cpp/file.h>

#include <iostream>
#include <map>
#include <memory>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#include <google/protobuf/compiler/scc.h>
#include <google/protobuf/io/printer.h>
#include <google/protobuf/stubs/strutil.h>
#include <google/protobuf/compiler/cpp/enum.h>
#include <google/protobuf/compiler/cpp/extension.h>
#include <google/protobuf/compiler/cpp/field.h>
#include <google/protobuf/compiler/cpp/helpers.h>
#include <google/protobuf/compiler/cpp/message.h>
#include <google/protobuf/compiler/cpp/service.h>
#include <google/protobuf/descriptor.pb.h>

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

namespace google {
namespace protobuf {
namespace compiler {
namespace cpp {

namespace {

// When we forward-declare things, we want to create a sorted order so our
// output is deterministic and minimizes namespace changes.
template <class T>
std::string GetSortKey(const T& val) {}

template <>
std::string GetSortKey<FileDescriptor>(const FileDescriptor& val) {}

template <class T>
bool CompareSortKeys(const T* a, const T* b) {}

template <class T>
std::vector<const T*> Sorted(const std::unordered_set<const T*>& vals) {}

// TODO(b/203101078): remove pragmas that suppresses uninitialized warnings when
// clang bug is fixed.
inline void MuteWuninitialized(Formatter& format) {}

inline void UnmuteWuninitialized(Formatter& format) {}

}  // namespace

FileGenerator::FileGenerator(const FileDescriptor* file, const Options& options)
    :{}

FileGenerator::~FileGenerator() = default;

void FileGenerator::GenerateMacroUndefs(io::Printer* printer) {}

void FileGenerator::GenerateHeader(io::Printer* printer) {}

void FileGenerator::GenerateProtoHeader(io::Printer* printer,
                                        const std::string& info_path) {}

void FileGenerator::GeneratePBHeader(io::Printer* printer,
                                     const std::string& info_path) {}

void FileGenerator::DoIncludeFile(const std::string& google3_name,
                                  bool do_export, io::Printer* printer) {}

std::string FileGenerator::CreateHeaderInclude(const std::string& basename,
                                               const FileDescriptor* file) {}

void FileGenerator::GenerateSourceIncludes(io::Printer* printer) {}

void FileGenerator::GenerateSourcePrelude(io::Printer* printer) {}

void FileGenerator::GenerateSourceDefaultInstance(int idx,
                                                  io::Printer* printer) {}

// A list of things defined in one .pb.cc file that we need to reference from
// another .pb.cc file.
struct FileGenerator::CrossFileReferences {};

void FileGenerator::GetCrossFileReferencesForField(const FieldDescriptor* field,
                                                   CrossFileReferences* refs) {}

void FileGenerator::GetCrossFileReferencesForFile(const FileDescriptor* file,
                                                  CrossFileReferences* refs) {}

// Generates references to variables defined in other files.
void FileGenerator::GenerateInternalForwardDeclarations(
    const CrossFileReferences& refs, io::Printer* printer) {}

void FileGenerator::GenerateSourceForMessage(int idx, io::Printer* printer) {}

void FileGenerator::GenerateSourceForExtension(int idx, io::Printer* printer) {}

void FileGenerator::GenerateGlobalSource(io::Printer* printer) {}

void FileGenerator::GenerateSource(io::Printer* printer) {}

void FileGenerator::GenerateReflectionInitializationCode(io::Printer* printer) {}

class FileGenerator::ForwardDeclarations {};

static void PublicImportDFS(const FileDescriptor* fd,
                            std::unordered_set<const FileDescriptor*>* fd_set) {}

void FileGenerator::GenerateForwardDeclarations(io::Printer* printer) {}

void FileGenerator::GenerateTopHeaderGuard(io::Printer* printer, bool pb_h) {}

void FileGenerator::GenerateBottomHeaderGuard(io::Printer* printer, bool pb_h) {}

void FileGenerator::GenerateLibraryIncludes(io::Printer* printer) {}

void FileGenerator::GenerateMetadataPragma(io::Printer* printer,
                                           const std::string& info_path) {}

void FileGenerator::GenerateDependencyIncludes(io::Printer* printer) {}

void FileGenerator::GenerateGlobalStateFunctionDeclarations(
    io::Printer* printer) {}

void FileGenerator::GenerateMessageDefinitions(io::Printer* printer) {}

void FileGenerator::GenerateEnumDefinitions(io::Printer* printer) {}

void FileGenerator::GenerateServiceDefinitions(io::Printer* printer) {}

void FileGenerator::GenerateExtensionIdentifiers(io::Printer* printer) {}

void FileGenerator::GenerateInlineFunctionDefinitions(io::Printer* printer) {}

void FileGenerator::GenerateProto2NamespaceEnumSpecializations(
    io::Printer* printer) {}

}  // namespace cpp
}  // namespace compiler
}  // namespace protobuf
}  // namespace google