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
42c08cbc
Commit
42c08cbc
authored
Nov 11, 2019
by
Derek Bailey
Committed by
Wouter van Oortmerssen
Nov 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ran src/clang-format-all.sh (#5617)
parent
33d5dd9b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
15 additions
and
20 deletions
+15
-20
schema_interface.h
grpc/src/compiler/schema_interface.h
+2
-2
grpctest.cpp
grpc/tests/grpctest.cpp
+6
-10
message_builder_test.cpp
grpc/tests/message_builder_test.cpp
+0
-0
reflection.h
include/flatbuffers/reflection.h
+1
-1
sample_bfbs.cpp
samples/sample_bfbs.cpp
+2
-2
sample_binary.cpp
samples/sample_binary.cpp
+1
-1
sample_text.cpp
samples/sample_text.cpp
+1
-2
idl_gen_js_ts.cpp
src/idl_gen_js_ts.cpp
+2
-1
test.cpp
tests/test.cpp
+0
-1
No files found.
grpc/src/compiler/schema_interface.h
View file @
42c08cbc
...
...
@@ -34,11 +34,11 @@
#ifndef GRPC_INTERNAL_COMPILER_SCHEMA_INTERFACE_H
#define GRPC_INTERNAL_COMPILER_SCHEMA_INTERFACE_H
#include "src/compiler/config.h"
#include <memory>
#include <vector>
#include "src/compiler/config.h"
#ifndef GRPC_CUSTOM_STRING
# include <string>
# define GRPC_CUSTOM_STRING std::string
...
...
grpc/tests/grpctest.cpp
View file @
42c08cbc
...
...
@@ -14,17 +14,17 @@
* limitations under the License.
*/
#include <thread>
#include <grpc++/grpc++.h>
#include <thread>
#include "monster_test.grpc.fb.h"
#include "monster_test_generated.h"
#include "test_assert.h"
using
namespace
MyGame
::
Example
;
using
flatbuffers
::
grpc
::
MessageBuilder
;
using
flatbuffers
::
FlatBufferBuilder
;
using
flatbuffers
::
grpc
::
MessageBuilder
;
void
message_builder_tests
();
...
...
@@ -97,8 +97,7 @@ void RunServer() {
server_instance
->
Wait
();
}
template
<
class
Builder
>
void
StoreRPC
(
MonsterStorage
::
Stub
*
stub
)
{
template
<
class
Builder
>
void
StoreRPC
(
MonsterStorage
::
Stub
*
stub
)
{
Builder
fbb
;
grpc
::
ClientContext
context
;
// Build a request with the name set.
...
...
@@ -119,8 +118,7 @@ void StoreRPC(MonsterStorage::Stub *stub) {
}
}
template
<
class
Builder
>
void
RetrieveRPC
(
MonsterStorage
::
Stub
*
stub
)
{
template
<
class
Builder
>
void
RetrieveRPC
(
MonsterStorage
::
Stub
*
stub
)
{
Builder
fbb
;
grpc
::
ClientContext
context
;
fbb
.
Clear
();
...
...
@@ -155,7 +153,6 @@ int grpc_server_test() {
RetrieveRPC
<
MessageBuilder
>
(
stub
.
get
());
RetrieveRPC
<
FlatBufferBuilder
>
(
stub
.
get
());
#if !FLATBUFFERS_GRPC_DISABLE_AUTO_VERIFICATION
{
// Test that an invalid request errors out correctly
...
...
@@ -181,7 +178,7 @@ int grpc_server_test() {
return
0
;
}
int
main
(
int
/*argc*/
,
const
char
*
/*argv*/
[])
{
int
main
(
int
/*argc*/
,
const
char
*
/*argv*/
[])
{
message_builder_tests
();
grpc_server_test
();
...
...
@@ -193,4 +190,3 @@ int main(int /*argc*/, const char * /*argv*/ []) {
return
1
;
}
}
grpc/tests/message_builder_test.cpp
View file @
42c08cbc
This diff is collapsed.
Click to expand it.
include/flatbuffers/reflection.h
View file @
42c08cbc
...
...
@@ -228,7 +228,7 @@ inline std::string GetAnyVectorElemS(const VectorOfAny *vec,
template
<
typename
T
>
T
*
GetAnyVectorElemPointer
(
const
VectorOfAny
*
vec
,
size_t
i
)
{
auto
elem_ptr
=
vec
->
Data
()
+
sizeof
(
uoffset_t
)
*
i
;
return
reinterpret_cast
<
T
*>
(
elem_ptr
+
ReadScalar
<
uoffset_t
>
(
elem_ptr
));
return
reinterpret_cast
<
T
*>
(
elem_ptr
+
ReadScalar
<
uoffset_t
>
(
elem_ptr
));
}
// Get the inline-address of a vector element. Useful for Structs (pass Struct
...
...
samples/sample_bfbs.cpp
View file @
42c08cbc
...
...
@@ -16,7 +16,6 @@
#include "flatbuffers/idl.h"
#include "flatbuffers/util.h"
#include "monster_generated.h" // Already includes "flatbuffers/flatbuffers.h".
using
namespace
MyGame
::
Sample
;
...
...
@@ -30,7 +29,8 @@ int main(int /*argc*/, const char * /*argv*/[]) {
std
::
string
bfbs_file
;
bool
ok
=
flatbuffers
::
LoadFile
(
"tests/monster_test.fbs"
,
false
,
&
schema_file
)
&&
flatbuffers
::
LoadFile
(
"tests/monsterdata_test.golden"
,
false
,
&
json_file
)
&&
flatbuffers
::
LoadFile
(
"tests/monsterdata_test.golden"
,
false
,
&
json_file
)
&&
flatbuffers
::
LoadFile
(
"tests/monster_test.bfbs"
,
true
,
&
bfbs_file
);
if
(
!
ok
)
{
printf
(
"couldn't load files!
\n
"
);
...
...
samples/sample_binary.cpp
View file @
42c08cbc
...
...
@@ -20,7 +20,7 @@ using namespace MyGame::Sample;
// Example how to use FlatBuffers to create and read binary buffers.
int
main
(
int
/*argc*/
,
const
char
*
/*argv*/
[])
{
int
main
(
int
/*argc*/
,
const
char
*
/*argv*/
[])
{
// Build up a serialized buffer algorithmically:
flatbuffers
::
FlatBufferBuilder
builder
;
...
...
samples/sample_text.cpp
View file @
42c08cbc
...
...
@@ -16,14 +16,13 @@
#include "flatbuffers/idl.h"
#include "flatbuffers/util.h"
#include "monster_generated.h" // Already includes "flatbuffers/flatbuffers.h".
using
namespace
MyGame
::
Sample
;
// This is an example of parsing text straight into a buffer and then
// generating flatbuffer (JSON) text from the buffer.
int
main
(
int
/*argc*/
,
const
char
*
/*argv*/
[])
{
int
main
(
int
/*argc*/
,
const
char
*
/*argv*/
[])
{
// load FlatBuffer schema (.fbs) and JSON from disk
std
::
string
schemafile
;
std
::
string
jsonfile
;
...
...
src/idl_gen_js_ts.cpp
View file @
42c08cbc
...
...
@@ -1014,7 +1014,8 @@ class JsTsGenerator : public BaseGenerator {
}
// Adds the mutable scalar value to the output
if
(
IsScalar
(
field
.
value
.
type
.
base_type
)
&&
parser
.
opts
.
mutable_buffer
&&
!
IsUnion
(
field
.
value
.
type
))
{
if
(
IsScalar
(
field
.
value
.
type
.
base_type
)
&&
parser
.
opts
.
mutable_buffer
&&
!
IsUnion
(
field
.
value
.
type
))
{
std
::
string
annotations
=
GenTypeAnnotation
(
kParam
,
GenTypeName
(
field
.
value
.
type
,
true
),
"value"
);
GenDocComment
(
...
...
tests/test.cpp
View file @
42c08cbc
...
...
@@ -2308,7 +2308,6 @@ void InvalidNestedFlatbufferTest() {
TEST_EQ
(
parser1
.
Parse
(
"{ name:
\"
Bender
\"
, testnestedflatbuffer: { name: "
"
\"
Leela
\"
, color:
\"
nonexistent
\"
}}"
),
false
);
// Check that Parser is destroyed correctly after parsing invalid json
}
void
UnionVectorTest
()
{
...
...
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