| 153 | } |
| 154 | |
| 155 | MClass* 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 | |
| 188 | void MAssembly::OnLoading() |
| 189 | { |
nothing calls this directly
no test coverage detected