cesium-native  0.41.0
SchemaWriter.h
1 #pragma once
2 
3 #include "CesiumGltfWriter/Library.h"
4 
5 #include <CesiumJsonWriter/ExtensionWriterContext.h>
6 
7 // forward declarations
8 namespace CesiumGltf {
9 struct Schema;
10 }
11 
12 namespace CesiumGltfWriter {
13 
18 struct CESIUMGLTFWRITER_API SchemaWriterResult {
22  std::vector<std::byte> schemaBytes;
23 
27  std::vector<std::string> errors;
28 
32  std::vector<std::string> warnings;
33 };
34 
38 struct CESIUMGLTFWRITER_API SchemaWriterOptions {
42  bool prettyPrint = false;
43 };
44 
48 class CESIUMGLTFWRITER_API SchemaWriter {
49 public:
54 
59 
64 
74  const CesiumGltf::Schema& schema,
75  const SchemaWriterOptions& options = SchemaWriterOptions()) const;
76 
77 private:
79 };
80 
81 } // namespace CesiumGltfWriter
const CesiumJsonWriter::ExtensionWriterContext & getExtensions() const
Gets the context used to control how schema extensions are written.
CesiumJsonWriter::ExtensionWriterContext & getExtensions()
Gets the context used to control how schema extensions are written.
SchemaWriterResult writeSchema(const CesiumGltf::Schema &schema, const SchemaWriterOptions &options=SchemaWriterOptions()) const
Serializes the provided schema object into a byte vector using the provided flags to convert.
SchemaWriter()
Constructs a new instance.
Classes for writing glTF models.
Definition: GltfWriter.h:14
Classes for working with glTF models.
Options for how to write a schema.
Definition: SchemaWriter.h:38
The result of writing a schema with SchemaWriterWriter::writeSchema.
Definition: SchemaWriter.h:18
std::vector< std::string > warnings
Warnings, if any, that occurred during the write process.
Definition: SchemaWriter.h:32
std::vector< std::byte > schemaBytes
The final generated std::vector<std::byte> of the schema JSON.
Definition: SchemaWriter.h:22
std::vector< std::string > errors
Errors, if any, that occurred during the write process.
Definition: SchemaWriter.h:27
An object defining classes and enums.
Definition: Schema.h:19