Implement __str__ and __repr__ for struct and list builders. __str__ uses prettyPrint while __repr__ shows the type name and the low-whitespace stringification. Also implement __repr__ for StructSchema, just because why not?

This commit is contained in:
Kenton Varda
2013-08-31 15:07:13 -07:00
parent 688cecffab
commit 10c6f40c2e
2 changed files with 54 additions and 1 deletions

View File

@@ -14,6 +14,12 @@ cdef extern from "capnp/common.h" namespace " ::capnp":
cdef extern from "kj/string.h" namespace " ::kj":
cdef cppclass StringPtr:
StringPtr(char *)
cdef cppclass String:
char* cStr()
cdef extern from "kj/string-tree.h" namespace " ::kj":
cdef cppclass StringTree:
String flatten()
cdef extern from "kj/common.h" namespace " ::kj":
cdef cppclass Maybe[T]: