sbepp
Loading...
Searching...
No Matches
Using the schema compiler

Usage:

sbeppc [OPTIONS]... FILE
Options:
--schema-name NAME override schema name. Uses `messageSchema.package` by
default
--output-dir DIR output directory. Uses current directory by default
--inject-include PATH injects `#include "PATH"` directive at the top of
`schema/schema.hpp`
--version print version and exit
--help print this help and exit
-- end of optional arguments

Here's an example of the resulting file structure:

output_dir/schema_name/ # `schema_name` directory is generated by sbeppc
schema_name.hpp # contains everything
schema/
schema.hpp # contains tags
types/ # contains public types
type_a.hpp # file per type
type_b.hpp
# ...
messages/ # contains messages
message_a.hpp # file per message
message_b.hpp
# ...

Here, schema, types and messages are hardcoded names, files for type/message will have the same name as their corresponding entity in XML schema.
Each of those headers includes its type dependencies so usually one needs to include only the message-related headers.

Note
Existing files are always overwritten.

In the description above, schema_name is by default taken from messageSchema.package attribute. This name is also used for a top-level namespace name and thus should follow C++ naming rules. However, SBE requirements for messageSchema.package are much weaker, actually, this attribute is optional. For cases when default name is not valid/desired, there's a --schema-name option to specify/override schema name.

Note
sbeppc is not a reference SBE schema validation tool. It implements the standard only to extent required for correct data representation. It does its best but please don't rely on it for complete schema validation.