-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathparsed-schema.cpp
More file actions
24 lines (19 loc) · 831 Bytes
/
Copy pathparsed-schema.cpp
File metadata and controls
24 lines (19 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "parsed-schema.h"
#include "schema-node-reader.h"
#include "struct-schema.h"
namespace capnp_php {
ParsedSchema::ParsedSchema(const ::capnp::ParsedSchema & schema,
Php::Value schemaParser)
: schemaParser(schemaParser), schema(schema) {
}
Php::Value ParsedSchema::getProto() {
return Php::Object("\\CAPNP\\SchemaNodeReader", new SchemaNodeReader(schema.getProto(), this));
}
Php::Value ParsedSchema::getNested(Php::Parameters& params) {
auto nestedSchema = schema.getNested(params[0].stringValue());
return Php::Object("\\CAPNP\\ParsedSchema", new ParsedSchema(nestedSchema, this));
}
Php::Value ParsedSchema::asStruct() {
return Php::Object("\\CAPNP\\StructSchema", new StructSchema(schema.asStruct(), this));
}
}