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

Method Split

src/NodeRTLib/ProjectFiles/CollectionsWrap.h:1564–1606  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1562 }
1563
1564 static void Split(Nan::NAN_METHOD_ARGS_TYPE info) {
1565 HandleScope scope;
1566
1567 if (!NodeRT::Utils::IsWinRtWrapperOf<
1568 ::Windows::Foundation::Collections::IMapView<K, V> ^>(
1569 info.This())) {
1570 return;
1571 }
1572
1573 MapViewWrapper<K, V>* wrapper =
1574 MapViewWrapper<K, V>::Unwrap<MapViewWrapper<K, V>>(info.This());
1575
1576 if (info.Length() == 0) {
1577 try {
1578 ::Windows::Foundation::Collections::IMapView<K, V> ^ first;
1579 ::Windows::Foundation::Collections::IMapView<K, V> ^ second;
1580
1581 wrapper->_instance->Split(&first, &second);
1582
1583 Local<Object> resObj = Nan::New<Object>();
1584 Nan::Set(
1585 resObj, Nan::New<String>("first").ToLocalChecked(),
1586 MapViewWrapper<K, V>::CreateMapViewWrapper(
1587 first, wrapper->_keyGetterFunc, wrapper->_checkTypeFunc,
1588 wrapper->_convertToKeyTypeFunc, wrapper->_valueGetterFunc));
1589 Nan::Set(
1590 resObj, Nan::New<String>("second").ToLocalChecked(),
1591 MapViewWrapper<K, V>::CreateMapViewWrapper(
1592 second, wrapper->_keyGetterFunc, wrapper->_checkTypeFunc,
1593 wrapper->_convertToKeyTypeFunc, wrapper->_valueGetterFunc));
1594 info.GetReturnValue().Set(resObj);
1595 } catch (Platform::Exception ^ exception) {
1596 NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
1597 return;
1598 }
1599 } else {
1600 Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(
1601 L"Bad arguments: no suitable overload found")));
1602 return;
1603 }
1604
1605 return;
1606 }
1607
1608 static void SizeGetter(Local<String> property,
1609 const Nan::PropertyCallbackInfo<v8::Value>& info) {

Callers 2

GenerateModelMethod · 0.80

Calls 2

NewStringFunction · 0.85
SetMethod · 0.45

Tested by

no test coverage detected