Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
flatbuffers
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
flatbuffers
Commits
85faa46f
Commit
85faa46f
authored
May 03, 2018
by
iceboy
Committed by
Wouter van Oortmerssen
May 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix union escaping order. (#4722)
* Fix union escaping order. Fixes #4712 * style
parent
cc354ea3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
idl_gen_cpp.cpp
src/idl_gen_cpp.cpp
+6
-3
No files found.
src/idl_gen_cpp.cpp
View file @
85faa46f
...
...
@@ -1638,7 +1638,9 @@ class CppGenerator : public BaseGenerator {
auto
full_struct_name
=
GetUnionElement
(
ev
,
true
,
true
);
// @TODO: Mby make this decisions more universal? How?
code_
.
SetValue
(
"U_GET_TYPE"
,
Name
(
field
)
+
UnionTypeFieldSuffix
());
code_
.
SetValue
(
"U_GET_TYPE"
,
EscapeKeyword
(
field
.
name
+
UnionTypeFieldSuffix
()));
code_
.
SetValue
(
"U_ELEMENT_TYPE"
,
WrapInNameSpace
(
u
->
defined_namespace
,
GetEnumValUse
(
*
u
,
ev
)));
...
...
@@ -1994,8 +1996,9 @@ class CppGenerator : public BaseGenerator {
std
::
string
GenUnionUnpackVal
(
const
FieldDef
&
afield
,
const
char
*
vec_elem_access
,
const
char
*
vec_type_access
)
{
return
afield
.
value
.
type
.
enum_def
->
name
+
"Union::UnPack("
+
"_e"
+
vec_elem_access
+
", "
+
Name
(
afield
)
+
UnionTypeFieldSuffix
()
+
return
afield
.
value
.
type
.
enum_def
->
name
+
"Union::UnPack("
+
"_e"
+
vec_elem_access
+
", "
+
EscapeKeyword
(
afield
.
name
+
UnionTypeFieldSuffix
())
+
"()"
+
vec_type_access
+
", _resolver)"
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment