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

Method GetView

src/NodeRTLib/ProjectFiles/CollectionsWrap.h:1897–1925  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1895 }
1896
1897 static void GetView(Nan::NAN_METHOD_ARGS_TYPE info) {
1898 HandleScope scope;
1899
1900 if (!NodeRT::Utils::IsWinRtWrapperOf<
1901 ::Windows::Foundation::Collections::IMap<K, V> ^>(info.This())) {
1902 return;
1903 }
1904
1905 MapWrapper<K, V>* wrapper =
1906 MapWrapper<K, V>::Unwrap<MapWrapper<K, V>>(info.This());
1907
1908 if (info.Length() == 0) {
1909 try {
1910 ::Windows::Foundation::Collections::IMapView<K, V> ^ result =
1911 wrapper->_instance->GetView();
1912
1913 info.GetReturnValue().Set(MapViewWrapper<K, V>::CreateMapViewWrapper(
1914 result, wrapper->_keyGetterFunc, wrapper->_checkKeyTypeFunc,
1915 wrapper->_convertToKeyTypeFunc, wrapper->_valueGetterFunc));
1916 } catch (Platform::Exception ^ exception) {
1917 NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
1918 return;
1919 }
1920 } else {
1921 Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(
1922 L"Bad arguments: no suitable overload found")));
1923 return;
1924 }
1925 }
1926
1927 static void Clear(Nan::NAN_METHOD_ARGS_TYPE info) {
1928 HandleScope scope;

Callers 1

GetViewMethod · 0.45

Calls 2

NewStringFunction · 0.85
SetMethod · 0.45

Tested by

no test coverage detected