MCPcopy Create free account
hub / github.com/NodeRT/NodeRT / GetView

Method GetView

src/NodeRTLib/ProjectFiles/CollectionsWrap.h:928–957  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

926 }
927
928 static void GetView(Nan::NAN_METHOD_ARGS_TYPE info) {
929 HandleScope scope;
930
931 if (!NodeRT::Utils::IsWinRtWrapperOf<
932 ::Windows::Foundation::Collections::IVector<T> ^>(info.This())) {
933 return;
934 }
935
936 VectorWrapper<T>* wrapper =
937 VectorWrapper<T>::Unwrap<VectorWrapper<T>>(info.This());
938
939 if (info.Length() == 0) {
940 try {
941 ::Windows::Foundation::Collections::IVectorView<T> ^ result =
942 wrapper->_instance->GetView();
943 info.GetReturnValue().Set(VectorViewWrapper<T>::CreateVectorViewWrapper(
944 result, wrapper->_getterFunc, wrapper->_checkTypeFunc,
945 wrapper->_convertToTypeFunc));
946 } catch (Platform::Exception ^ exception) {
947 NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
948 return;
949 }
950 } else {
951 Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(
952 L"Bad arguments: no suitable overload found")));
953 return;
954 }
955
956 return;
957 }
958
959 static void InsertAt(Nan::NAN_METHOD_ARGS_TYPE info) {
960 HandleScope scope;

Callers

nothing calls this directly

Calls 3

NewStringFunction · 0.85
GetViewMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected