mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-25 11:38:40 +00:00
[JS] Add getFullyQualifiedName() (#6119)
This optionally generates a static `getFullyQualifiedName()` function to get the fully-qualified name of a type in JavaScript and TypeScript in a similar fashion to the C++ codegen.
This commit is contained in:
@@ -66,6 +66,9 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) StructInNestedNS FLATBUFFERS_FINAL_CLASS
|
||||
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
|
||||
return StructInNestedNSTypeTable();
|
||||
}
|
||||
static FLATBUFFERS_CONSTEXPR const char *GetFullyQualifiedName() {
|
||||
return "NamespaceA.NamespaceB.StructInNestedNS";
|
||||
}
|
||||
StructInNestedNS()
|
||||
: a_(0),
|
||||
b_(0) {
|
||||
@@ -102,6 +105,9 @@ inline bool operator!=(const StructInNestedNS &lhs, const StructInNestedNS &rhs)
|
||||
|
||||
struct TableInNestedNST : public flatbuffers::NativeTable {
|
||||
typedef TableInNestedNS TableType;
|
||||
static FLATBUFFERS_CONSTEXPR const char *GetFullyQualifiedName() {
|
||||
return "NamespaceA.NamespaceB.TableInNestedNST";
|
||||
}
|
||||
int32_t foo;
|
||||
TableInNestedNST()
|
||||
: foo(0) {
|
||||
@@ -124,6 +130,9 @@ struct TableInNestedNS FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
|
||||
return TableInNestedNSTypeTable();
|
||||
}
|
||||
static FLATBUFFERS_CONSTEXPR const char *GetFullyQualifiedName() {
|
||||
return "NamespaceA.NamespaceB.TableInNestedNS";
|
||||
}
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_FOO = 4
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user