chromium/third_party/flatbuffers/src/src/bfbs_gen.h

/*
 * Copyright 2021 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.
 */

#ifndef FLATBUFFERS_BFBS_GEN_H_
#define FLATBUFFERS_BFBS_GEN_H_

#include <cstdint>

#include "flatbuffers/code_generator.h"
#include "flatbuffers/reflection_generated.h"

namespace flatbuffers {

namespace {

static void ForAllEnums(
    const flatbuffers::Vector<flatbuffers::Offset<reflection::Enum>> *enums,
    std::function<void(const reflection::Enum *)> func) {}

static void ForAllObjects(
    const flatbuffers::Vector<flatbuffers::Offset<reflection::Object>> *objects,
    std::function<void(const reflection::Object *)> func) {}

static void ForAllEnumValues(
    const reflection::Enum *enum_def,
    std::function<void(const reflection::EnumVal *)> func) {}

static void ForAllDocumentation(
    const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>
        *documentation,
    std::function<void(const flatbuffers::String *)> func) {}

// Maps the field index into object->fields() to the field's ID (the ith element
// in the return vector).
static std::vector<uint32_t> FieldIdToIndex(const reflection::Object *object) {}

static bool IsStructOrTable(const reflection::BaseType base_type) {}

static bool IsFloatingPoint(const reflection::BaseType base_type) {}

static bool IsBool(const reflection::BaseType base_type) {}

static bool IsSingleByte(const reflection::BaseType base_type) {}

static bool IsVector(const reflection::BaseType base_type) {}

}  // namespace

// A concrete base Flatbuffer Generator that specific language generators can
// derive from.
class BaseBfbsGenerator : public CodeGenerator {};

}  // namespace flatbuffers

#endif  // FLATBUFFERS_BFBS_GEN_H_