unitest.proto.file <- system.file("tinytest", "data", "unittest.proto",
package = "RProtoBuf" )
readProtoFiles(file = unitest.proto.file)
test <- new(protobuf_unittest.TestAllTypes)
test$has("optional_int32")
# FALSE
test$add("repeated_int32", 1:10)
test$has("repeated_int32")
# TRUE
test$has("nonexistant")
# NULL
has(protobuf_unittest.TestAllTypes$NestedEnum, "FOO")
has(protobuf_unittest.TestAllTypes$NestedEnum, "BAR")
has(protobuf_unittest.TestAllTypes$NestedEnum, "XXX")
Run the code above in your browser using DataLab