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

Method GetClass

Source/Engine/Scripting/ManagedCLR/MCore.cpp:155–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155MClass* MAssembly::GetClass(const StringAnsiView& fullname) const
156{
157 // Check state
158 if (!IsLoaded())
159 {
160 Log::InvalidOperationException(TEXT("MAssembly was not yet loaded or loading was in progress"));
161 return nullptr;
162 }
163
164 StringAnsiView key(fullname);
165
166 // Special case for reference
167 if (fullname[fullname.Length() - 1] == '&')
168 key = StringAnsiView(key.Get(), key.Length() - 1);
169
170 // Find class by name
171 const auto& classes = GetClasses();
172 MClass* result = nullptr;
173 classes.TryGet(key, result);
174
175#if 0
176 if (!result)
177 {
178 LOG(Warning, "Failed to find class {0} in assembly {1}. Classes:", String(fullname), ToString());
179 for (auto i = classes.Begin(); i.IsNotEnd(); ++i)
180 {
181 LOG(Warning, " - {0}", String(i->Key));
182 }
183 }
184#endif
185 return result;
186}
187
188void MAssembly::OnLoading()
189{

Callers

nothing calls this directly

Calls 10

IsLoadedFunction · 0.70
StringAnsiViewClass · 0.50
StringFunction · 0.50
ToStringFunction · 0.50
LengthMethod · 0.45
GetMethod · 0.45
TryGetMethod · 0.45
BeginMethod · 0.45
IsNotEndMethod · 0.45

Tested by

no test coverage detected