chromium/third_party/flatbuffers/src/grpc/src/compiler/ts_generator.cc

/*
 * Copyright 2020 Google Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * NOTE: The following implementation is a translation for the Swift-grpc
 * generator since flatbuffers doesnt allow plugins for now. if an issue arises
 * please open an issue in the flatbuffers repository. This file should always
 * be maintained according to the Swift-grpc repository
 */

#include "src/compiler/ts_generator.h"

#include <map>
#include <sstream>

#include "flatbuffers/util.h"
#include "src/compiler/schema_interface.h"

namespace grpc_ts_generator {
namespace {

static grpc::string GenerateNamespace(const std::vector<std::string> ns,
                               const std::string filename,
                               const bool include_separator) {}

// MARK: - Shared code

static void GenerateImports(const grpc_generator::Service *service,
                     grpc_generator::Printer *printer,
                     std::map<grpc::string, grpc::string> *dictonary,
                     const bool grpc_var_import) {}

// MARK: - Generate Main GRPC Code

static void GetStreamType(grpc_generator::Printer *printer,
                   const grpc_generator::Method *method,
                   std::map<grpc::string, grpc::string> *dictonary) {}

static void GenerateSerializeMethod(grpc_generator::Printer *printer,
                             std::map<grpc::string, grpc::string> *dictonary) {}

static void GenerateDeserializeMethod(
    grpc_generator::Printer *printer,
    std::map<grpc::string, grpc::string> *dictonary) {}

static void GenerateMethods(const grpc_generator::Service *service,
                     grpc_generator::Printer *printer,
                     std::map<grpc::string, grpc::string> *dictonary) {}

static void GenerateService(const grpc_generator::Service *service,
                     grpc_generator::Printer *printer,
                     std::map<grpc::string, grpc::string> *dictonary) {}

} // namespace

grpc::string Generate(grpc_generator::File *file,
                      const grpc_generator::Service *service,
                      const grpc::string &filename) {}

namespace {

// MARK: - Generate Interface

static void FillInterface(grpc_generator::Printer *printer,
                   std::map<grpc::string, grpc::string> *dictonary) {}

static void GenerateInterfaces(const grpc_generator::Service *service,
                        grpc_generator::Printer *printer,
                        std::map<grpc::string, grpc::string> *dictonary) {}

static void GenerateExportedInterface(
    const grpc_generator::Service *service, grpc_generator::Printer *printer,
    std::map<grpc::string, grpc::string> *dictonary) {}

static void GenerateMainInterface(const grpc_generator::Service *service,
                           grpc_generator::Printer *printer,
                           std::map<grpc::string, grpc::string> *dictonary) {}

static grpc::string GenerateMetaData() {}

static grpc::string GenerateOptions() {}

static void GenerateUnaryClientInterface(
    grpc_generator::Printer *printer,
    std::map<grpc::string, grpc::string> *dictonary) {}

static void GenerateClientWriteStreamInterface(
    grpc_generator::Printer *printer,
    std::map<grpc::string, grpc::string> *dictonary) {}

static void GenerateClientReadableStreamInterface(
    grpc_generator::Printer *printer,
    std::map<grpc::string, grpc::string> *dictonary) {}

static void GenerateDepluxStreamInterface(
    grpc_generator::Printer *printer,
    std::map<grpc::string, grpc::string> *dictonary) {}

static void GenerateClientInterface(const grpc_generator::Service *service,
                             grpc_generator::Printer *printer,
                             std::map<grpc::string, grpc::string> *dictonary) {}

static void GenerateClientClassInterface(
    const grpc_generator::Service *service, grpc_generator::Printer *printer,
    std::map<grpc::string, grpc::string> *dictonary) {}
} // namespace


grpc::string GenerateInterface(grpc_generator::File *file,
                               const grpc_generator::Service *service,
                               const grpc::string &filename) {}
}  // namespace grpc_ts_generator