mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-04 18:21:10 +00:00
clang-all (#6941)
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#ifndef FLATBUFFERS_BASE_H_
|
#ifndef FLATBUFFERS_BASE_H_
|
||||||
# define FLATBUFFERS_BASE_H_
|
#define FLATBUFFERS_BASE_H_
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
#ifndef FLATBUFFERS_FLATBUFFER_BUILDER_H_
|
#ifndef FLATBUFFERS_FLATBUFFER_BUILDER_H_
|
||||||
#define FLATBUFFERS_FLATBUFFER_BUILDER_H_
|
#define FLATBUFFERS_FLATBUFFER_BUILDER_H_
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
#include "flatbuffers/allocator.h"
|
#include "flatbuffers/allocator.h"
|
||||||
#include "flatbuffers/array.h"
|
#include "flatbuffers/array.h"
|
||||||
#include "flatbuffers/base.h"
|
#include "flatbuffers/base.h"
|
||||||
@@ -31,8 +33,6 @@
|
|||||||
#include "flatbuffers/vector_downward.h"
|
#include "flatbuffers/vector_downward.h"
|
||||||
#include "flatbuffers/verifier.h"
|
#include "flatbuffers/verifier.h"
|
||||||
|
|
||||||
#include <functional>
|
|
||||||
|
|
||||||
namespace flatbuffers {
|
namespace flatbuffers {
|
||||||
|
|
||||||
// Converts a Field ID to a virtual table offset.
|
// Converts a Field ID to a virtual table offset.
|
||||||
@@ -107,7 +107,8 @@ class FlatBufferBuilder {
|
|||||||
string_pool(nullptr) {
|
string_pool(nullptr) {
|
||||||
EndianCheck();
|
EndianCheck();
|
||||||
// Default construct and swap idiom.
|
// Default construct and swap idiom.
|
||||||
// Lack of delegating constructors in vs2010 makes it more verbose than needed.
|
// Lack of delegating constructors in vs2010 makes it more verbose than
|
||||||
|
// needed.
|
||||||
Swap(other);
|
Swap(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -676,8 +677,9 @@ class FlatBufferBuilder {
|
|||||||
/// returns any type that you can construct a FlatBuffers vector out of.
|
/// returns any type that you can construct a FlatBuffers vector out of.
|
||||||
/// @return Returns a typed `Offset` into the serialized data indicating
|
/// @return Returns a typed `Offset` into the serialized data indicating
|
||||||
/// where the vector is stored.
|
/// where the vector is stored.
|
||||||
template<typename T> Offset<Vector<T>> CreateVector(size_t vector_size,
|
template<typename T>
|
||||||
const std::function<T (size_t i)> &f) {
|
Offset<Vector<T>> CreateVector(size_t vector_size,
|
||||||
|
const std::function<T(size_t i)> &f) {
|
||||||
FLATBUFFERS_ASSERT(FLATBUFFERS_GENERAL_HEAP_ALLOC_OK);
|
FLATBUFFERS_ASSERT(FLATBUFFERS_GENERAL_HEAP_ALLOC_OK);
|
||||||
std::vector<T> elems(vector_size);
|
std::vector<T> elems(vector_size);
|
||||||
for (size_t i = 0; i < vector_size; i++) elems[i] = f(i);
|
for (size_t i = 0; i < vector_size; i++) elems[i] = f(i);
|
||||||
@@ -795,15 +797,16 @@ class FlatBufferBuilder {
|
|||||||
|
|
||||||
/// @brief Serialize an array of structs into a FlatBuffer `vector`.
|
/// @brief Serialize an array of structs into a FlatBuffer `vector`.
|
||||||
/// @tparam T The data type of the struct array elements.
|
/// @tparam T The data type of the struct array elements.
|
||||||
/// @param[in] filler A function that takes the current iteration 0..vector_size-1
|
/// @param[in] filler A function that takes the current iteration
|
||||||
/// and a pointer to the struct that must be filled.
|
/// 0..vector_size-1 and a pointer to the struct that must be filled.
|
||||||
/// @return Returns a typed `Offset` into the serialized data indicating
|
/// @return Returns a typed `Offset` into the serialized data indicating
|
||||||
/// where the vector is stored.
|
/// where the vector is stored.
|
||||||
/// This is mostly useful when flatbuffers are generated with mutation
|
/// This is mostly useful when flatbuffers are generated with mutation
|
||||||
/// accessors.
|
/// accessors.
|
||||||
template<typename T> Offset<Vector<const T *>> CreateVectorOfStructs(
|
template<typename T>
|
||||||
|
Offset<Vector<const T *>> CreateVectorOfStructs(
|
||||||
size_t vector_size, const std::function<void(size_t i, T *)> &filler) {
|
size_t vector_size, const std::function<void(size_t i, T *)> &filler) {
|
||||||
T* structs = StartVectorOfStructs<T>(vector_size);
|
T *structs = StartVectorOfStructs<T>(vector_size);
|
||||||
for (size_t i = 0; i < vector_size; i++) {
|
for (size_t i = 0; i < vector_size; i++) {
|
||||||
filler(i, structs);
|
filler(i, structs);
|
||||||
structs++;
|
structs++;
|
||||||
|
|||||||
@@ -92,9 +92,9 @@ struct NativeTable {};
|
|||||||
/// if you wish. The resolver does the opposite lookup, for when the object
|
/// if you wish. The resolver does the opposite lookup, for when the object
|
||||||
/// is being serialized again.
|
/// is being serialized again.
|
||||||
typedef uint64_t hash_value_t;
|
typedef uint64_t hash_value_t;
|
||||||
typedef std::function<void (void **pointer_adr, hash_value_t hash)>
|
typedef std::function<void(void **pointer_adr, hash_value_t hash)>
|
||||||
resolver_function_t;
|
resolver_function_t;
|
||||||
typedef std::function<hash_value_t (void *pointer)> rehasher_function_t;
|
typedef std::function<hash_value_t(void *pointer)> rehasher_function_t;
|
||||||
|
|
||||||
// Helper function to test if a field is present, using any of the field
|
// Helper function to test if a field is present, using any of the field
|
||||||
// enums in the generated code.
|
// enums in the generated code.
|
||||||
|
|||||||
@@ -1132,8 +1132,8 @@ class Builder FLATBUFFERS_FINAL_CLASS {
|
|||||||
// sorted fashion.
|
// sorted fashion.
|
||||||
// std::sort is typically already a lot faster on sorted data though.
|
// std::sort is typically already a lot faster on sorted data though.
|
||||||
auto dict = reinterpret_cast<TwoValue *>(stack_.data() + start);
|
auto dict = reinterpret_cast<TwoValue *>(stack_.data() + start);
|
||||||
std::sort(dict, dict + len,
|
std::sort(
|
||||||
[&](const TwoValue &a, const TwoValue &b) -> bool {
|
dict, dict + len, [&](const TwoValue &a, const TwoValue &b) -> bool {
|
||||||
auto as = reinterpret_cast<const char *>(buf_.data() + a.key.u_);
|
auto as = reinterpret_cast<const char *>(buf_.data() + a.key.u_);
|
||||||
auto bs = reinterpret_cast<const char *>(buf_.data() + b.key.u_);
|
auto bs = reinterpret_cast<const char *>(buf_.data() + b.key.u_);
|
||||||
auto comp = strcmp(as, bs);
|
auto comp = strcmp(as, bs);
|
||||||
@@ -1404,12 +1404,10 @@ class Builder FLATBUFFERS_FINAL_CLASS {
|
|||||||
|
|
||||||
template<typename T> static Type GetScalarType() {
|
template<typename T> static Type GetScalarType() {
|
||||||
static_assert(flatbuffers::is_scalar<T>::value, "Unrelated types");
|
static_assert(flatbuffers::is_scalar<T>::value, "Unrelated types");
|
||||||
return flatbuffers::is_floating_point<T>::value
|
return flatbuffers::is_floating_point<T>::value ? FBT_FLOAT
|
||||||
? FBT_FLOAT
|
|
||||||
: flatbuffers::is_same<T, bool>::value
|
: flatbuffers::is_same<T, bool>::value
|
||||||
? FBT_BOOL
|
? FBT_BOOL
|
||||||
: (flatbuffers::is_unsigned<T>::value ? FBT_UINT
|
: (flatbuffers::is_unsigned<T>::value ? FBT_UINT : FBT_INT);
|
||||||
: FBT_INT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#ifndef FLATBUFFERS_IDL_H_
|
#ifndef FLATBUFFERS_IDL_H_
|
||||||
#define FLATBUFFERS_IDL_H_
|
#define FLATBUFFERS_IDL_H_
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <stack>
|
#include <stack>
|
||||||
@@ -27,8 +28,6 @@
|
|||||||
#include "flatbuffers/hash.h"
|
#include "flatbuffers/hash.h"
|
||||||
#include "flatbuffers/reflection.h"
|
#include "flatbuffers/reflection.h"
|
||||||
|
|
||||||
#include <functional>
|
|
||||||
|
|
||||||
// This file defines the data types representing a parsed IDL (Interface
|
// This file defines the data types representing a parsed IDL (Interface
|
||||||
// Definition Language) / schema file.
|
// Definition Language) / schema file.
|
||||||
|
|
||||||
|
|||||||
@@ -702,7 +702,9 @@ class CppGenerator : public BaseGenerator {
|
|||||||
}
|
}
|
||||||
case BASE_TYPE_UNION:
|
case BASE_TYPE_UNION:
|
||||||
// fall through
|
// fall through
|
||||||
default: { return "void"; }
|
default: {
|
||||||
|
return "void";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1044,10 +1046,9 @@ class CppGenerator : public BaseGenerator {
|
|||||||
? bt - BASE_TYPE_UTYPE + ET_UTYPE
|
? bt - BASE_TYPE_UTYPE + ET_UTYPE
|
||||||
: ET_SEQUENCE;
|
: ET_SEQUENCE;
|
||||||
int ref_idx = -1;
|
int ref_idx = -1;
|
||||||
std::string ref_name =
|
std::string ref_name = type.struct_def ? WrapInNameSpace(*type.struct_def)
|
||||||
type.struct_def
|
: type.enum_def ? WrapInNameSpace(*type.enum_def)
|
||||||
? WrapInNameSpace(*type.struct_def)
|
: "";
|
||||||
: type.enum_def ? WrapInNameSpace(*type.enum_def) : "";
|
|
||||||
if (!ref_name.empty()) {
|
if (!ref_name.empty()) {
|
||||||
auto rit = type_refs.begin();
|
auto rit = type_refs.begin();
|
||||||
for (; rit != type_refs.end(); ++rit) {
|
for (; rit != type_refs.end(); ++rit) {
|
||||||
@@ -2000,7 +2001,9 @@ class CppGenerator : public BaseGenerator {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: { break; }
|
default: {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2258,7 +2261,9 @@ class CppGenerator : public BaseGenerator {
|
|||||||
code_ += " bool mutate_{{FIELD_NAME}}({{FIELD_TYPE}} _{{FIELD_NAME}}\\";
|
code_ += " bool mutate_{{FIELD_NAME}}({{FIELD_TYPE}} _{{FIELD_NAME}}\\";
|
||||||
if (false == field.IsScalarOptional()) {
|
if (false == field.IsScalarOptional()) {
|
||||||
code_.SetValue("DEFAULT_VALUE", GenDefaultConstant(field));
|
code_.SetValue("DEFAULT_VALUE", GenDefaultConstant(field));
|
||||||
code_.SetValue("INTERFACE_DEFAULT_VALUE", GenUnderlyingCast(field, true, GenDefaultConstant(field)));
|
code_.SetValue(
|
||||||
|
"INTERFACE_DEFAULT_VALUE",
|
||||||
|
GenUnderlyingCast(field, true, GenDefaultConstant(field)));
|
||||||
|
|
||||||
// GenUnderlyingCast for a bool field generates 0 != 0
|
// GenUnderlyingCast for a bool field generates 0 != 0
|
||||||
// So the type has to be checked and the appropriate default chosen
|
// So the type has to be checked and the appropriate default chosen
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ class CSharpGenerator : public BaseGenerator {
|
|||||||
public:
|
public:
|
||||||
CSharpGenerator(const Parser &parser, const std::string &path,
|
CSharpGenerator(const Parser &parser, const std::string &path,
|
||||||
const std::string &file_name)
|
const std::string &file_name)
|
||||||
: BaseGenerator(parser, path, file_name, parser.opts.cs_global_alias ? "global::" : "", ".", "cs"),
|
: BaseGenerator(parser, path, file_name,
|
||||||
|
parser.opts.cs_global_alias ? "global::" : "", ".", "cs"),
|
||||||
cur_name_space_(nullptr) {
|
cur_name_space_(nullptr) {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
|
||||||
@@ -305,11 +306,13 @@ class CSharpGenerator : public BaseGenerator {
|
|||||||
// would be cast down to int before being put onto the buffer. In C#, one cast
|
// would be cast down to int before being put onto the buffer. In C#, one cast
|
||||||
// directly cast an Enum to its underlying type, which is essential before
|
// directly cast an Enum to its underlying type, which is essential before
|
||||||
// putting it onto the buffer.
|
// putting it onto the buffer.
|
||||||
std::string SourceCast(const Type &type, const bool isOptional=false) const {
|
std::string SourceCast(const Type &type,
|
||||||
|
const bool isOptional = false) const {
|
||||||
if (IsSeries(type)) {
|
if (IsSeries(type)) {
|
||||||
return SourceCast(type.VectorType());
|
return SourceCast(type.VectorType());
|
||||||
} else {
|
} else {
|
||||||
if (IsEnum(type)) return "(" + GenTypeBasic(type, false) + (isOptional ? "?": "") + ")";
|
if (IsEnum(type))
|
||||||
|
return "(" + GenTypeBasic(type, false) + (isOptional ? "?" : "") + ")";
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -1221,8 +1224,10 @@ class CSharpGenerator : public BaseGenerator {
|
|||||||
code += "Add";
|
code += "Add";
|
||||||
code += GenMethod(vector_type);
|
code += GenMethod(vector_type);
|
||||||
code += "(";
|
code += "(";
|
||||||
// At the moment there is no support of the type Vector with optional enum,
|
// At the moment there is no support of the type Vector with
|
||||||
// e.g. if we have enum type SomeEnum there is no way to define `SomeEmum?[] enums` in FlatBuffer schema, so isOptional = false
|
// optional enum, e.g. if we have enum type SomeEnum there is no way
|
||||||
|
// to define `SomeEmum?[] enums` in FlatBuffer schema, so isOptional
|
||||||
|
// = false
|
||||||
code += SourceCastBasic(vector_type, false);
|
code += SourceCastBasic(vector_type, false);
|
||||||
code += "data[i]";
|
code += "data[i]";
|
||||||
if (vector_type.base_type == BASE_TYPE_STRUCT ||
|
if (vector_type.base_type == BASE_TYPE_STRUCT ||
|
||||||
@@ -1641,8 +1646,7 @@ class CSharpGenerator : public BaseGenerator {
|
|||||||
case BASE_TYPE_ARRAY: {
|
case BASE_TYPE_ARRAY: {
|
||||||
auto type_name = GenTypeGet_ObjectAPI(field.value.type, opts);
|
auto type_name = GenTypeGet_ObjectAPI(field.value.type, opts);
|
||||||
auto length_str = NumToString(field.value.type.fixed_length);
|
auto length_str = NumToString(field.value.type.fixed_length);
|
||||||
auto unpack_method = field.value.type.struct_def == nullptr
|
auto unpack_method = field.value.type.struct_def == nullptr ? ""
|
||||||
? ""
|
|
||||||
: field.value.type.struct_def->fixed
|
: field.value.type.struct_def->fixed
|
||||||
? ".UnPack()"
|
? ".UnPack()"
|
||||||
: "?.UnPack()";
|
: "?.UnPack()";
|
||||||
|
|||||||
@@ -130,7 +130,9 @@ std::string GenType(const Type &type) {
|
|||||||
return union_type_string;
|
return union_type_string;
|
||||||
}
|
}
|
||||||
case BASE_TYPE_UTYPE: return GenTypeRef(type.enum_def);
|
case BASE_TYPE_UTYPE: return GenTypeRef(type.enum_def);
|
||||||
default: { return GenBaseType(type); }
|
default: {
|
||||||
|
return GenBaseType(type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,9 +176,10 @@ class JsonSchemaGenerator : public BaseGenerator {
|
|||||||
// remove leading and trailing spaces from comment line
|
// remove leading and trailing spaces from comment line
|
||||||
const auto start = std::find_if(comment_line.begin(), comment_line.end(),
|
const auto start = std::find_if(comment_line.begin(), comment_line.end(),
|
||||||
[](char c) { return !isspace(c); });
|
[](char c) { return !isspace(c); });
|
||||||
const auto end = std::find_if(comment_line.rbegin(), comment_line.rend(),
|
const auto end =
|
||||||
[](char c) { return !isspace(c); })
|
std::find_if(comment_line.rbegin(), comment_line.rend(), [](char c) {
|
||||||
.base();
|
return !isspace(c);
|
||||||
|
}).base();
|
||||||
if (start < end) {
|
if (start < end) {
|
||||||
comment.append(start, end);
|
comment.append(start, end);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -300,12 +300,12 @@ class KotlinGenerator : public BaseGenerator {
|
|||||||
}
|
}
|
||||||
writer += ")";
|
writer += ")";
|
||||||
});
|
});
|
||||||
GenerateFunOneLine(writer, "name", "e: Int", "String",
|
GenerateFunOneLine(
|
||||||
|
writer, "name", "e: Int", "String",
|
||||||
[&]() {
|
[&]() {
|
||||||
writer += "names[e\\";
|
writer += "names[e\\";
|
||||||
if (enum_def.MinValue()->IsNonZero())
|
if (enum_def.MinValue()->IsNonZero())
|
||||||
writer += " - " + enum_def.MinValue()->name +
|
writer += " - " + enum_def.MinValue()->name + ".toInt()\\";
|
||||||
".toInt()\\";
|
|
||||||
writer += "]";
|
writer += "]";
|
||||||
},
|
},
|
||||||
parser_.opts.gen_jvmstatic);
|
parser_.opts.gen_jvmstatic);
|
||||||
@@ -422,7 +422,8 @@ class KotlinGenerator : public BaseGenerator {
|
|||||||
(nameprefix + (field.name + "_")).c_str());
|
(nameprefix + (field.name + "_")).c_str());
|
||||||
} else {
|
} else {
|
||||||
writer.SetValue("type", GenMethod(field.value.type));
|
writer.SetValue("type", GenMethod(field.value.type));
|
||||||
writer.SetValue("argname", nameprefix + MakeCamel(Esc(field.name), false));
|
writer.SetValue("argname",
|
||||||
|
nameprefix + MakeCamel(Esc(field.name), false));
|
||||||
writer.SetValue("cast", CastToSigned(field.value.type));
|
writer.SetValue("cast", CastToSigned(field.value.type));
|
||||||
writer += "builder.put{{type}}({{argname}}{{cast}})";
|
writer += "builder.put{{type}}({{argname}}{{cast}})";
|
||||||
}
|
}
|
||||||
@@ -622,7 +623,8 @@ class KotlinGenerator : public BaseGenerator {
|
|||||||
auto id = identifier.length() > 0 ? ", \"" + identifier + "\"" : "";
|
auto id = identifier.length() > 0 ? ", \"" + identifier + "\"" : "";
|
||||||
auto params = "builder: FlatBufferBuilder, offset: Int";
|
auto params = "builder: FlatBufferBuilder, offset: Int";
|
||||||
auto method_name = "finish" + Esc(struct_def.name) + "Buffer";
|
auto method_name = "finish" + Esc(struct_def.name) + "Buffer";
|
||||||
GenerateFunOneLine(writer, method_name, params, "",
|
GenerateFunOneLine(
|
||||||
|
writer, method_name, params, "",
|
||||||
[&]() { writer += "builder.finish(offset" + id + ")"; },
|
[&]() { writer += "builder.finish(offset" + id + ")"; },
|
||||||
options.gen_jvmstatic);
|
options.gen_jvmstatic);
|
||||||
}
|
}
|
||||||
@@ -635,12 +637,12 @@ class KotlinGenerator : public BaseGenerator {
|
|||||||
auto returns = "Int";
|
auto returns = "Int";
|
||||||
auto field_vec = struct_def.fields.vec;
|
auto field_vec = struct_def.fields.vec;
|
||||||
|
|
||||||
GenerateFun(writer, name, params, returns,
|
GenerateFun(
|
||||||
|
writer, name, params, returns,
|
||||||
[&]() {
|
[&]() {
|
||||||
writer += "val o = builder.endTable()";
|
writer += "val o = builder.endTable()";
|
||||||
writer.IncrementIdentLevel();
|
writer.IncrementIdentLevel();
|
||||||
for (auto it = field_vec.begin(); it != field_vec.end();
|
for (auto it = field_vec.begin(); it != field_vec.end(); ++it) {
|
||||||
++it) {
|
|
||||||
auto &field = **it;
|
auto &field = **it;
|
||||||
if (field.deprecated || !field.IsRequired()) { continue; }
|
if (field.deprecated || !field.IsRequired()) { continue; }
|
||||||
writer.SetValue("offset", NumToString(field.value.offset));
|
writer.SetValue("offset", NumToString(field.value.offset));
|
||||||
@@ -664,10 +666,10 @@ class KotlinGenerator : public BaseGenerator {
|
|||||||
writer.SetValue("root", GenMethod(vector_type));
|
writer.SetValue("root", GenMethod(vector_type));
|
||||||
writer.SetValue("cast", CastToSigned(vector_type));
|
writer.SetValue("cast", CastToSigned(vector_type));
|
||||||
|
|
||||||
GenerateFun(writer, method_name, params, "Int",
|
GenerateFun(
|
||||||
|
writer, method_name, params, "Int",
|
||||||
[&]() {
|
[&]() {
|
||||||
writer +=
|
writer += "builder.startVector({{size}}, data.size, {{align}})";
|
||||||
"builder.startVector({{size}}, data.size, {{align}})";
|
|
||||||
writer += "for (i in data.size - 1 downTo 0) {";
|
writer += "for (i in data.size - 1 downTo 0) {";
|
||||||
writer.IncrementIdentLevel();
|
writer.IncrementIdentLevel();
|
||||||
writer += "builder.add{{root}}(data[i]{{cast}})";
|
writer += "builder.add{{root}}(data[i]{{cast}})";
|
||||||
@@ -701,12 +703,12 @@ class KotlinGenerator : public BaseGenerator {
|
|||||||
auto field_type = GenTypeBasic(field.value.type.base_type);
|
auto field_type = GenTypeBasic(field.value.type.base_type);
|
||||||
auto secondArg = MakeCamel(Esc(field.name), false) + ": " + field_type;
|
auto secondArg = MakeCamel(Esc(field.name), false) + ": " + field_type;
|
||||||
|
|
||||||
GenerateFunOneLine(writer, "add" + MakeCamel(Esc(field.name), true),
|
GenerateFunOneLine(
|
||||||
|
writer, "add" + MakeCamel(Esc(field.name), true),
|
||||||
"builder: FlatBufferBuilder, " + secondArg, "",
|
"builder: FlatBufferBuilder, " + secondArg, "",
|
||||||
[&]() {
|
[&]() {
|
||||||
auto method = GenMethod(field.value.type);
|
auto method = GenMethod(field.value.type);
|
||||||
writer.SetValue("field_name",
|
writer.SetValue("field_name", MakeCamel(Esc(field.name), false));
|
||||||
MakeCamel(Esc(field.name), false));
|
|
||||||
writer.SetValue("method_name", method);
|
writer.SetValue("method_name", method);
|
||||||
writer.SetValue("pos", field_pos);
|
writer.SetValue("pos", field_pos);
|
||||||
writer.SetValue("default", GenFBBDefaultValue(field));
|
writer.SetValue("default", GenFBBDefaultValue(field));
|
||||||
@@ -1011,7 +1013,8 @@ class KotlinGenerator : public BaseGenerator {
|
|||||||
break;
|
break;
|
||||||
default: found = "{{bbgetter}}({{index}}){{ucast}}";
|
default: found = "{{bbgetter}}({{index}}){{ucast}}";
|
||||||
}
|
}
|
||||||
OffsetWrapper(writer, offset_val, [&]() { writer += found; },
|
OffsetWrapper(
|
||||||
|
writer, offset_val, [&]() { writer += found; },
|
||||||
[&]() { writer += not_found; });
|
[&]() { writer += not_found; });
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
@@ -1164,10 +1167,10 @@ class KotlinGenerator : public BaseGenerator {
|
|||||||
if (struct_def.fixed) {
|
if (struct_def.fixed) {
|
||||||
writer += "{{bbsetter}}({{index}}, {{params}}{{cast}})";
|
writer += "{{bbsetter}}({{index}}, {{params}}{{cast}})";
|
||||||
} else {
|
} else {
|
||||||
OffsetWrapper(writer, offset_val,
|
OffsetWrapper(
|
||||||
|
writer, offset_val,
|
||||||
[&]() {
|
[&]() {
|
||||||
writer +=
|
writer += "{{bbsetter}}({{index}}, {{params}}{{cast}})";
|
||||||
"{{bbsetter}}({{index}}, {{params}}{{cast}})";
|
|
||||||
writer += "true";
|
writer += "true";
|
||||||
},
|
},
|
||||||
[&]() { writer += "false"; });
|
[&]() { writer += "false"; });
|
||||||
@@ -1313,7 +1316,8 @@ class KotlinGenerator : public BaseGenerator {
|
|||||||
const IDLOptions options) {
|
const IDLOptions options) {
|
||||||
// create a struct constructor function
|
// create a struct constructor function
|
||||||
auto params = StructConstructorParams(struct_def);
|
auto params = StructConstructorParams(struct_def);
|
||||||
GenerateFun(code, "create" + Esc(struct_def.name), params, "Int",
|
GenerateFun(
|
||||||
|
code, "create" + Esc(struct_def.name), params, "Int",
|
||||||
[&]() {
|
[&]() {
|
||||||
GenStructBody(struct_def, code, "");
|
GenStructBody(struct_def, code, "");
|
||||||
code += "return builder.offset()";
|
code += "return builder.offset()";
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace flatbuffers {
|
|||||||
namespace python {
|
namespace python {
|
||||||
|
|
||||||
// Hardcode spaces per indentation.
|
// Hardcode spaces per indentation.
|
||||||
const CommentConfig def_comment = {nullptr, "#", nullptr};
|
const CommentConfig def_comment = { nullptr, "#", nullptr };
|
||||||
const std::string Indent = " ";
|
const std::string Indent = " ";
|
||||||
|
|
||||||
class PythonGenerator : public BaseGenerator {
|
class PythonGenerator : public BaseGenerator {
|
||||||
@@ -46,7 +46,8 @@ class PythonGenerator : public BaseGenerator {
|
|||||||
"class", "continue", "def", "del", "elif", "else", "except",
|
"class", "continue", "def", "del", "elif", "else", "except",
|
||||||
"finally", "for", "from", "global", "if", "import", "in",
|
"finally", "for", "from", "global", "if", "import", "in",
|
||||||
"is", "lambda", "nonlocal", "not", "or", "pass", "raise",
|
"is", "lambda", "nonlocal", "not", "or", "pass", "raise",
|
||||||
"return", "try", "while", "with", "yield"};
|
"return", "try", "while", "with", "yield"
|
||||||
|
};
|
||||||
keywords_.insert(std::begin(keywords), std::end(keywords));
|
keywords_.insert(std::begin(keywords), std::end(keywords));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,9 +207,7 @@ class PythonGenerator : public BaseGenerator {
|
|||||||
code += OffsetPrefix(field);
|
code += OffsetPrefix(field);
|
||||||
getter += "o + self._tab.Pos)";
|
getter += "o + self._tab.Pos)";
|
||||||
auto is_bool = IsBool(field.value.type.base_type);
|
auto is_bool = IsBool(field.value.type.base_type);
|
||||||
if (is_bool) {
|
if (is_bool) { getter = "bool(" + getter + ")"; }
|
||||||
getter = "bool(" + getter + ")";
|
|
||||||
}
|
|
||||||
code += Indent + Indent + Indent + "return " + getter + "\n";
|
code += Indent + Indent + Indent + "return " + getter + "\n";
|
||||||
std::string default_value;
|
std::string default_value;
|
||||||
if (is_bool) {
|
if (is_bool) {
|
||||||
@@ -398,9 +397,7 @@ class PythonGenerator : public BaseGenerator {
|
|||||||
|
|
||||||
// Currently, we only support accessing as numpy array if
|
// Currently, we only support accessing as numpy array if
|
||||||
// the vector type is a scalar.
|
// the vector type is a scalar.
|
||||||
if (!(IsScalar(vectortype.base_type))) {
|
if (!(IsScalar(vectortype.base_type))) { return; }
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
GenReceiver(struct_def, code_ptr);
|
GenReceiver(struct_def, code_ptr);
|
||||||
code += MakeCamel(NormalizedName(field)) + "AsNumpy(self):";
|
code += MakeCamel(NormalizedName(field)) + "AsNumpy(self):";
|
||||||
@@ -425,9 +422,7 @@ class PythonGenerator : public BaseGenerator {
|
|||||||
const FieldDef &field,
|
const FieldDef &field,
|
||||||
std::string *code_ptr) {
|
std::string *code_ptr) {
|
||||||
auto nested = field.attributes.Lookup("nested_flatbuffer");
|
auto nested = field.attributes.Lookup("nested_flatbuffer");
|
||||||
if (!nested) {
|
if (!nested) { return; } // There is no nested flatbuffer.
|
||||||
return;
|
|
||||||
} // There is no nested flatbuffer.
|
|
||||||
|
|
||||||
std::string unqualified_name = nested->constant;
|
std::string unqualified_name = nested->constant;
|
||||||
std::string qualified_name = nested->constant;
|
std::string qualified_name = nested->constant;
|
||||||
@@ -490,9 +485,7 @@ class PythonGenerator : public BaseGenerator {
|
|||||||
} else {
|
} else {
|
||||||
auto &code = *code_ptr;
|
auto &code = *code_ptr;
|
||||||
code += std::string(", ") + nameprefix;
|
code += std::string(", ") + nameprefix;
|
||||||
if (has_field_name) {
|
if (has_field_name) { code += MakeCamel(NormalizedName(field), false); }
|
||||||
code += MakeCamel(NormalizedName(field), false);
|
|
||||||
}
|
|
||||||
code += namesuffix;
|
code += namesuffix;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -646,9 +639,7 @@ class PythonGenerator : public BaseGenerator {
|
|||||||
const FieldDef &field,
|
const FieldDef &field,
|
||||||
std::string *code_ptr) {
|
std::string *code_ptr) {
|
||||||
auto nested = field.attributes.Lookup("nested_flatbuffer");
|
auto nested = field.attributes.Lookup("nested_flatbuffer");
|
||||||
if (!nested) {
|
if (!nested) { return; } // There is no nested flatbuffer.
|
||||||
return;
|
|
||||||
} // There is no nested flatbuffer.
|
|
||||||
|
|
||||||
std::string unqualified_name = nested->constant;
|
std::string unqualified_name = nested->constant;
|
||||||
std::string qualified_name = nested->constant;
|
std::string qualified_name = nested->constant;
|
||||||
@@ -743,11 +734,8 @@ class PythonGenerator : public BaseGenerator {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case BASE_TYPE_UNION:
|
case BASE_TYPE_UNION: GetUnionField(struct_def, field, code_ptr); break;
|
||||||
GetUnionField(struct_def, field, code_ptr);
|
default: FLATBUFFERS_ASSERT(0);
|
||||||
break;
|
|
||||||
default:
|
|
||||||
FLATBUFFERS_ASSERT(0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (IsVector(field.value.type) || IsArray(field.value.type)) {
|
if (IsVector(field.value.type) || IsArray(field.value.type)) {
|
||||||
@@ -918,14 +906,9 @@ class PythonGenerator : public BaseGenerator {
|
|||||||
import_list->insert("import " + package_reference);
|
import_list->insert("import " + package_reference);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BASE_TYPE_STRING:
|
case BASE_TYPE_STRING: field_type += "str"; break;
|
||||||
field_type += "str";
|
case BASE_TYPE_NONE: field_type += "None"; break;
|
||||||
break;
|
default: break;
|
||||||
case BASE_TYPE_NONE:
|
|
||||||
field_type += "None";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
field_types += field_type + separator_string;
|
field_types += field_type + separator_string;
|
||||||
}
|
}
|
||||||
@@ -1258,8 +1241,7 @@ class PythonGenerator : public BaseGenerator {
|
|||||||
GenUnPackForScalarVector(struct_def, field, &code);
|
GenUnPackForScalarVector(struct_def, field, &code);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default: GenUnPackForScalar(struct_def, field, &code);
|
||||||
GenUnPackForScalar(struct_def, field, &code);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1366,45 +1348,19 @@ class PythonGenerator : public BaseGenerator {
|
|||||||
|
|
||||||
std::string type_name;
|
std::string type_name;
|
||||||
switch (vectortype.base_type) {
|
switch (vectortype.base_type) {
|
||||||
case BASE_TYPE_BOOL:
|
case BASE_TYPE_BOOL: type_name = "Bool"; break;
|
||||||
type_name = "Bool";
|
case BASE_TYPE_CHAR: type_name = "Byte"; break;
|
||||||
break;
|
case BASE_TYPE_UCHAR: type_name = "Uint8"; break;
|
||||||
case BASE_TYPE_CHAR:
|
case BASE_TYPE_SHORT: type_name = "Int16"; break;
|
||||||
type_name = "Byte";
|
case BASE_TYPE_USHORT: type_name = "Uint16"; break;
|
||||||
break;
|
case BASE_TYPE_INT: type_name = "Int32"; break;
|
||||||
case BASE_TYPE_UCHAR:
|
case BASE_TYPE_UINT: type_name = "Uint32"; break;
|
||||||
type_name = "Uint8";
|
case BASE_TYPE_LONG: type_name = "Int64"; break;
|
||||||
break;
|
case BASE_TYPE_ULONG: type_name = "Uint64"; break;
|
||||||
case BASE_TYPE_SHORT:
|
case BASE_TYPE_FLOAT: type_name = "Float32"; break;
|
||||||
type_name = "Int16";
|
case BASE_TYPE_DOUBLE: type_name = "Float64"; break;
|
||||||
break;
|
case BASE_TYPE_STRING: type_name = "UOffsetTRelative"; break;
|
||||||
case BASE_TYPE_USHORT:
|
default: type_name = "VOffsetT"; break;
|
||||||
type_name = "Uint16";
|
|
||||||
break;
|
|
||||||
case BASE_TYPE_INT:
|
|
||||||
type_name = "Int32";
|
|
||||||
break;
|
|
||||||
case BASE_TYPE_UINT:
|
|
||||||
type_name = "Uint32";
|
|
||||||
break;
|
|
||||||
case BASE_TYPE_LONG:
|
|
||||||
type_name = "Int64";
|
|
||||||
break;
|
|
||||||
case BASE_TYPE_ULONG:
|
|
||||||
type_name = "Uint64";
|
|
||||||
break;
|
|
||||||
case BASE_TYPE_FLOAT:
|
|
||||||
type_name = "Float32";
|
|
||||||
break;
|
|
||||||
case BASE_TYPE_DOUBLE:
|
|
||||||
type_name = "Float64";
|
|
||||||
break;
|
|
||||||
case BASE_TYPE_STRING:
|
|
||||||
type_name = "UOffsetTRelative";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
type_name = "VOffsetT";
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
code += type_name;
|
code += type_name;
|
||||||
}
|
}
|
||||||
@@ -1665,8 +1621,7 @@ class PythonGenerator : public BaseGenerator {
|
|||||||
case BASE_TYPE_STRING:
|
case BASE_TYPE_STRING:
|
||||||
GenUnionCreatorForString(enum_def, ev, &code);
|
GenUnionCreatorForString(enum_def, ev, &code);
|
||||||
break;
|
break;
|
||||||
default:
|
default: break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
code += GenIndents(1) + "return None";
|
code += GenIndents(1) + "return None";
|
||||||
@@ -1690,12 +1645,9 @@ class PythonGenerator : public BaseGenerator {
|
|||||||
// Returns the function name that is able to read a value of the given type.
|
// Returns the function name that is able to read a value of the given type.
|
||||||
std::string GenGetter(const Type &type) {
|
std::string GenGetter(const Type &type) {
|
||||||
switch (type.base_type) {
|
switch (type.base_type) {
|
||||||
case BASE_TYPE_STRING:
|
case BASE_TYPE_STRING: return "self._tab.String(";
|
||||||
return "self._tab.String(";
|
case BASE_TYPE_UNION: return "self._tab.Union(";
|
||||||
case BASE_TYPE_UNION:
|
case BASE_TYPE_VECTOR: return GenGetter(type.VectorType());
|
||||||
return "self._tab.Union(";
|
|
||||||
case BASE_TYPE_VECTOR:
|
|
||||||
return GenGetter(type.VectorType());
|
|
||||||
default:
|
default:
|
||||||
return "self._tab.Get(flatbuffers.number_types." +
|
return "self._tab.Get(flatbuffers.number_types." +
|
||||||
MakeCamel(GenTypeGet(type)) + "Flags, ";
|
MakeCamel(GenTypeGet(type)) + "Flags, ";
|
||||||
@@ -1725,16 +1677,12 @@ class PythonGenerator : public BaseGenerator {
|
|||||||
|
|
||||||
std::string GenTypePointer(const Type &type) {
|
std::string GenTypePointer(const Type &type) {
|
||||||
switch (type.base_type) {
|
switch (type.base_type) {
|
||||||
case BASE_TYPE_STRING:
|
case BASE_TYPE_STRING: return "string";
|
||||||
return "string";
|
case BASE_TYPE_VECTOR: return GenTypeGet(type.VectorType());
|
||||||
case BASE_TYPE_VECTOR:
|
case BASE_TYPE_STRUCT: return type.struct_def->name;
|
||||||
return GenTypeGet(type.VectorType());
|
|
||||||
case BASE_TYPE_STRUCT:
|
|
||||||
return type.struct_def->name;
|
|
||||||
case BASE_TYPE_UNION:
|
case BASE_TYPE_UNION:
|
||||||
// fall through
|
// fall through
|
||||||
default:
|
default: return "*flatbuffers.Table";
|
||||||
return "*flatbuffers.Table";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -264,8 +264,7 @@ class SwiftGenerator : public BaseGenerator {
|
|||||||
code_ += "}";
|
code_ += "}";
|
||||||
Outdent();
|
Outdent();
|
||||||
code_ += "}\n";
|
code_ += "}\n";
|
||||||
if (parser_.opts.gen_json_coders)
|
if (parser_.opts.gen_json_coders) GenerateJSONEncodingAPIs(struct_def);
|
||||||
GenerateJSONEncodingAPIs(struct_def);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildStructConstructor(const StructDef &struct_def) {
|
void BuildStructConstructor(const StructDef &struct_def) {
|
||||||
@@ -421,8 +420,7 @@ class SwiftGenerator : public BaseGenerator {
|
|||||||
GenerateVerifier(struct_def);
|
GenerateVerifier(struct_def);
|
||||||
Outdent();
|
Outdent();
|
||||||
code_ += "}\n";
|
code_ += "}\n";
|
||||||
if (parser_.opts.gen_json_coders)
|
if (parser_.opts.gen_json_coders) GenerateJSONEncodingAPIs(struct_def);
|
||||||
GenerateJSONEncodingAPIs(struct_def);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generates the reader for swift
|
// Generates the reader for swift
|
||||||
@@ -1196,8 +1194,7 @@ class SwiftGenerator : public BaseGenerator {
|
|||||||
AddMinOrMaxEnumValue(Name(*enum_def.MinValue()), "min");
|
AddMinOrMaxEnumValue(Name(*enum_def.MinValue()), "min");
|
||||||
Outdent();
|
Outdent();
|
||||||
code_ += "}\n";
|
code_ += "}\n";
|
||||||
if (parser_.opts.gen_json_coders)
|
if (parser_.opts.gen_json_coders) EnumEncoder(enum_def);
|
||||||
EnumEncoder(enum_def);
|
|
||||||
code_ += "";
|
code_ += "";
|
||||||
if (parser_.opts.generate_object_based_api && enum_def.is_union) {
|
if (parser_.opts.generate_object_based_api && enum_def.is_union) {
|
||||||
code_ += "{{ACCESS_TYPE}} struct {{ENUM_NAME}}Union {";
|
code_ += "{{ACCESS_TYPE}} struct {{ENUM_NAME}}Union {";
|
||||||
|
|||||||
@@ -583,7 +583,8 @@ class TsGenerator : public BaseGenerator {
|
|||||||
std::string fileName) {
|
std::string fileName) {
|
||||||
ImportDefinition import;
|
ImportDefinition import;
|
||||||
import.name = import_name;
|
import.name = import_name;
|
||||||
import.import_statement = "import " + import_name + " from '" + fileName + "';";
|
import.import_statement =
|
||||||
|
"import " + import_name + " from '" + fileName + "';";
|
||||||
imports.insert(std::make_pair(import_name, import));
|
imports.insert(std::make_pair(import_name, import));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -330,8 +330,7 @@ uint8_t *ResizeAnyVector(const reflection::Schema &schema, uoffset_t newsize,
|
|||||||
const reflection::Object *root_table) {
|
const reflection::Object *root_table) {
|
||||||
auto delta_elem = static_cast<int>(newsize) - static_cast<int>(num_elems);
|
auto delta_elem = static_cast<int>(newsize) - static_cast<int>(num_elems);
|
||||||
auto delta_bytes = delta_elem * static_cast<int>(elem_size);
|
auto delta_bytes = delta_elem * static_cast<int>(elem_size);
|
||||||
auto vec_start =
|
auto vec_start = reinterpret_cast<const uint8_t *>(vec) - flatbuf->data();
|
||||||
reinterpret_cast<const uint8_t *>(vec) - flatbuf->data();
|
|
||||||
auto start = static_cast<uoffset_t>(vec_start) +
|
auto start = static_cast<uoffset_t>(vec_start) +
|
||||||
static_cast<uoffset_t>(sizeof(uoffset_t)) +
|
static_cast<uoffset_t>(sizeof(uoffset_t)) +
|
||||||
elem_size * num_elems;
|
elem_size * num_elems;
|
||||||
|
|||||||
@@ -273,8 +273,7 @@ ClassicLocale ClassicLocale::instance_;
|
|||||||
|
|
||||||
std::string RemoveStringQuotes(const std::string &s) {
|
std::string RemoveStringQuotes(const std::string &s) {
|
||||||
auto ch = *s.c_str();
|
auto ch = *s.c_str();
|
||||||
return ((s.size() >= 2) && (ch == '\"' || ch == '\'') &&
|
return ((s.size() >= 2) && (ch == '\"' || ch == '\'') && (ch == s.back()))
|
||||||
(ch == s.back()))
|
|
||||||
? s.substr(1, s.length() - 2)
|
? s.substr(1, s.length() - 2)
|
||||||
: s;
|
: s;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ struct Vector3D {
|
|||||||
x = 0;
|
x = 0;
|
||||||
y = 0;
|
y = 0;
|
||||||
z = 0;
|
z = 0;
|
||||||
};
|
}
|
||||||
Vector3D(float _x, float _y, float _z) {
|
Vector3D(float _x, float _y, float _z) {
|
||||||
this->x = _x;
|
this->x = _x;
|
||||||
this->y = _y;
|
this->y = _y;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
#include "native_type_test_generated.h"
|
#include "native_type_test_generated.h"
|
||||||
#include "test_assert.h"
|
#include "test_assert.h"
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
// Check that char* and uint8_t* are interoperable types.
|
// Check that char* and uint8_t* are interoperable types.
|
||||||
// The reinterpret_cast<> between the pointers are used to simplify data loading.
|
// The reinterpret_cast<> between the pointers are used to simplify data loading.
|
||||||
static_assert(flatbuffers::is_same<uint8_t, char>::value ||
|
static_assert(flatbuffers::is_same<uint8_t, char>::value ||
|
||||||
@@ -100,9 +100,7 @@ flatbuffers::DetachedBuffer CreateFlatBufferTest(std::string &buffer) {
|
|||||||
|
|
||||||
// Create a vector of structures from a lambda.
|
// Create a vector of structures from a lambda.
|
||||||
auto testv2 = builder.CreateVectorOfStructs<Test>(
|
auto testv2 = builder.CreateVectorOfStructs<Test>(
|
||||||
2, [&](size_t i, Test* s) -> void {
|
2, [&](size_t i, Test *s) -> void { *s = tests[i]; });
|
||||||
*s = tests[i];
|
|
||||||
});
|
|
||||||
|
|
||||||
// create monster with very few fields set:
|
// create monster with very few fields set:
|
||||||
// (same functionality as CreateMonster below, but sets fields manually)
|
// (same functionality as CreateMonster below, but sets fields manually)
|
||||||
@@ -1596,7 +1594,9 @@ void FuzzTest2() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
AddToSchemaAndInstances(deprecated ? "(deprecated);\n" : ";\n",
|
AddToSchemaAndInstances(deprecated ? "(deprecated);\n" : ";\n",
|
||||||
deprecated ? "" : is_last_field ? "\n" : ",\n");
|
deprecated ? ""
|
||||||
|
: is_last_field ? "\n"
|
||||||
|
: ",\n");
|
||||||
}
|
}
|
||||||
AddToSchemaAndInstances("}\n\n", "}");
|
AddToSchemaAndInstances("}\n\n", "}");
|
||||||
}
|
}
|
||||||
@@ -3004,7 +3004,7 @@ void FlexBuffersTest() {
|
|||||||
int ints[] = { 1, 2, 3 };
|
int ints[] = { 1, 2, 3 };
|
||||||
slb.Vector("bar", ints, 3);
|
slb.Vector("bar", ints, 3);
|
||||||
slb.FixedTypedVector("bar3", ints, 3);
|
slb.FixedTypedVector("bar3", ints, 3);
|
||||||
bool bools[] = {true, false, true, false};
|
bool bools[] = { true, false, true, false };
|
||||||
slb.Vector("bools", bools, 4);
|
slb.Vector("bools", bools, 4);
|
||||||
slb.Bool("bool", true);
|
slb.Bool("bool", true);
|
||||||
slb.Double("foo", 100);
|
slb.Double("foo", 100);
|
||||||
|
|||||||
Reference in New Issue
Block a user