| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH | ||
| 2 | // | ||
| 3 | // SPDX-License-Identifier: MIT | ||
| 4 | |||
| 5 | #include "database_utilities.h" | ||
| 6 | |||
| 7 | using namespace imgdoc2; | ||
| 8 | |||
| 9 | 14 | /*static*/imgdoc2::DocumentType DbUtilities::GetDocumentTypeFromDocTypeField(const std::string& field) | |
| 10 | { | ||
| 11 |
2/2✓ Branch 2 taken 8 times.
✓ Branch 3 taken 6 times.
|
14 | if (field == GetDocTypeValueForDocumentType(DocumentType::kImage2d)) |
| 12 | { | ||
| 13 | 8 | return DocumentType::kImage2d; | |
| 14 | } | ||
| 15 |
1/2✓ Branch 2 taken 6 times.
✗ Branch 3 not taken.
|
6 | else if (field == GetDocTypeValueForDocumentType(DocumentType::kImage3d)) |
| 16 | { | ||
| 17 | 6 | return DocumentType::kImage3d; | |
| 18 | } | ||
| 19 | else | ||
| 20 | { | ||
| 21 | ✗ | return DocumentType::kInvalid; | |
| 22 | } | ||
| 23 | } | ||
| 24 | |||
| 25 | 278 | /*static*/const char* DbUtilities::GetDocTypeValueForDocumentType(imgdoc2::DocumentType document_type) | |
| 26 | { | ||
| 27 |
2/3✓ Branch 0 taken 198 times.
✓ Branch 1 taken 80 times.
✗ Branch 2 not taken.
|
278 | switch (document_type) |
| 28 | { | ||
| 29 | 198 | case DocumentType::kImage2d: | |
| 30 | 198 | return "Tiles2D"; | |
| 31 | 80 | case DocumentType::kImage3d: | |
| 32 | 80 | return "Bricks3D"; | |
| 33 | ✗ | default: | |
| 34 | ✗ | return nullptr; | |
| 35 | } | ||
| 36 | } | ||
| 37 |