Given the following dummy schema test.capnp:
struct Person {
   const type :Text = "person.type.example";
   version @0 :UInt32;
   name @1 :Text;
} 

At runtime, how can we read the default const value from a schema struct 
(i.e the "person.type.example" above? (type is not considered a field 
within the struct, but it does appear as a node in the proto):
std::string schema_filename = "test.capnp"; kj::ArrayPtr<const 
kj::StringPtr> import_paths;
capnp::SchemaParser parser;
capnp::ParsedSchema schema = parser.parseDiskFile( schema_filename.c_str(), 
                                                                        
 schema_filename.c_str(), import_paths);
auto person_maybe = schema.findNested("Person");
auto* person_schema = kj::_::readMaybe(person_maybe);

// how can I read "person.type.example" out of the Person struct?

Any guidance on the matter is appreciated, thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capnproto+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/389bc2ea-3279-4ddc-b8cc-f554d636767fn%40googlegroups.com.

Reply via email to