MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / ToNative

Method ToNative

Source/Engine/Localization/CultureInfo.cpp:182–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182CultureInfo MUtils::ToNative(void* value)
183{
184 int32 lcid = 127;
185#if USE_MONO
186 if (value)
187 lcid = static_cast<MonoCultureInfo*>(value)->lcid;
188#elif USE_CSHARP
189 PROFILE_MEM(Localization);
190 const MClass* klass = GetBinaryModuleCorlib()->Assembly->GetClass("System.Globalization.CultureInfo");
191 if (value && klass)
192 {
193 MProperty* lcidProperty = klass->GetProperty("LCID");
194 if (lcidProperty && lcidProperty->GetGetMethod())
195 {
196 MObject* lcidObj = lcidProperty->GetGetMethod()->Invoke(value, nullptr, nullptr);
197 lcid = *(int32*)MCore::Object::Unbox(lcidObj);
198 }
199 }
200#endif
201 return CultureInfo(lcid);
202}

Callers

nothing calls this directly

Calls 7

GetBinaryModuleCorlibFunction · 0.85
UnboxFunction · 0.85
CultureInfoClass · 0.85
GetClassMethod · 0.45
GetPropertyMethod · 0.45
GetGetMethodMethod · 0.45
InvokeMethod · 0.45

Tested by

no test coverage detected