[Rprotobuf-yada] Descriptor $ extration

Romain François francoisromain at free.fr
Thu Oct 29 18:39:17 CET 2009


Hi,

Now when you create a message Descriptor (google::protobuf::Descriptor), 
for example using the P function, you can use dollar extraction to grab 
either field descriptors of its fields or Descriptors of its inner types:


# scan the person.proto file and bring back a descriptor for the
# message type tutorial.Person
Person <- P( "tutorial.Person", file = "/tmp/person.proto" )

# grab the inner type tutorial.Person.PhoneNumber
Person$PhoneNumber

# grab the field descriptor for the "email" field of the
# Person message type
Person$email

Romain

-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://tr.im/BcPw : celebrating R commit #50000
|- http://tr.im/ztCu : RGG #158:161: examples of package IDPmisc
`- http://tr.im/yw8E : New R package : sos



More information about the Rprotobuf-yada mailing list