Executable Binaries containing their Messaging Schema

39 views
Skip to first unread message

Dejute Makielski

unread,
Jun 27, 2015, 4:51:35 PM6/27/15
to flatb...@googlegroups.com
Hi, I'm interested in creating program binaries that do not need any additional external Flatbuffers schema files.

I partly accomplished this by putting the contents of the .fbs file into the binary. CMake automatically generates the .h files and an additional resource C++ source file containing the schema definitions (approach inspired by http://stackoverflow.com/a/27206982). The program loads all schemas using the Parser class.

But as soon as a .fbs file contains an 'include' expression it won't work.

Is there an existing approach to bake the schema files into executable binaries?
I removed the include statements to check whether it works but is this the only solution?
How can cyclic dependencies be handled (i.e. node has edges, edges point to nodes)?

Dejute Makielski

unread,
Jun 27, 2015, 5:16:21 PM6/27/15
to flatb...@googlegroups.com
Sorry, I forgot to mention that I would like to be able to process and send both JSON and binary messages (easy compatibility to web frontends).
Thus, I need the schemas at runtime.

Dejute Makielski

unread,
Jun 28, 2015, 9:41:02 AM6/28/15
to flatb...@googlegroups.com

The 'source_filename' of Parser::Parse() solved my problem. :-)



Am Samstag, 27. Juni 2015 22:51:35 UTC+2 schrieb Dejute Makielski:

Wouter van Oortmerssen

unread,
Jun 29, 2015, 6:16:03 PM6/29/15
to Dejute Makielski, flatb...@googlegroups.com
Cool. Yes, we don't have a particular solution for including schema files in binaries.

We now have binary schema files, but for parsing you still need the text ones. That may change in the future.

--
You received this message because you are subscribed to the Google Groups "FlatBuffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flatbuffers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages