| 1364 | } |
| 1365 | |
| 1366 | MField::MField(MClass* parentClass, void* handle, const char* name, void* type, int fieldOffset, MFieldAttributes attributes) |
| 1367 | : _handle(handle) |
| 1368 | , _type(type) |
| 1369 | , _fieldOffset(fieldOffset) |
| 1370 | , _parentClass(parentClass) |
| 1371 | , _name(parentClass->GetAssembly()->AllocString(name)) |
| 1372 | , _hasCachedAttributes(false) |
| 1373 | , _attributes(&parentClass->GetAssembly()->Memory) |
| 1374 | { |
| 1375 | switch (attributes & MFieldAttributes::FieldAccessMask) |
| 1376 | { |
| 1377 | case MFieldAttributes::Private: |
| 1378 | _visibility = MVisibility::Private; |
| 1379 | break; |
| 1380 | case MFieldAttributes::FamANDAssem: |
| 1381 | _visibility = MVisibility::PrivateProtected; |
| 1382 | break; |
| 1383 | case MFieldAttributes::Assembly: |
| 1384 | _visibility = MVisibility::Internal; |
| 1385 | break; |
| 1386 | case MFieldAttributes::Family: |
| 1387 | _visibility = MVisibility::Protected; |
| 1388 | break; |
| 1389 | case MFieldAttributes::FamORAssem: |
| 1390 | _visibility = MVisibility::ProtectedInternal; |
| 1391 | break; |
| 1392 | case MFieldAttributes::Public: |
| 1393 | _visibility = MVisibility::Public; |
| 1394 | break; |
| 1395 | default: |
| 1396 | CRASH; |
| 1397 | } |
| 1398 | _isStatic = (attributes & MFieldAttributes::Static) == MFieldAttributes::Static; |
| 1399 | } |
| 1400 | |
| 1401 | MType* MField::GetType() const |
| 1402 | { |
nothing calls this directly
no test coverage detected