R/has.R

Defines functions ._has_enum_name ._has_message

setGeneric( "has", function( object, name, ... ){
	standardGeneric( "has" )
} )
._has_message <- function( object, name, ...){
	if (!.Call( "Message__field_exists", object@pointer, name, PACKAGE = "RProtoBuf" )) {
		return(NULL)
	} else {
		return(.Call( "Message__has_field", object@pointer, name, PACKAGE = "RProtoBuf" ))
	}
}
._has_enum_name <- function( object, name, ...){
  return(.Call( "has_enum_name", object@pointer, name, PACKAGE = "RProtoBuf"))
}

setMethod( "has", "Message", ._has_message )
setMethod( "has", "EnumDescriptor", ._has_enum_name)

Try the RProtoBuf package in your browser

Any scripts or data that you put into this service are public.

RProtoBuf documentation built on Nov. 3, 2022, 9:06 a.m.