MCPcopy Create free account
hub / github.com/apache/arrow / check_binary

Function check_binary

r/src/r_to_arrow.cpp:782–801  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

780};
781
782Status check_binary(SEXP x, int64_t size) {
783 RVectorType rtype = GetVectorType(x);
784 switch (rtype) {
785 case BINARY:
786 break;
787 case LIST: {
788 // check this is a list of raw vectors
789 const SEXP* p_x = VECTOR_PTR_RO(x);
790 for (R_xlen_t i = 0; i < size; i++, ++p_x) {
791 if (TYPEOF(*p_x) != RAWSXP && (*p_x != R_NilValue)) {
792 return Status::Invalid("invalid R type to convert to binary");
793 }
794 }
795 break;
796 }
797 default:
798 return Status::Invalid("invalid R type to convert to binary");
799 }
800 return Status::OK();
801}
802
803template <typename T>
804class RPrimitiveConverter<T, enable_if_binary<T>>

Callers 2

ExtendMethod · 0.85
ExtendMethod · 0.85

Calls 3

GetVectorTypeFunction · 0.85
InvalidClass · 0.50
OKFunction · 0.50

Tested by

no test coverage detected