| 22 | using namespace piscsi_util; |
| 23 | |
| 24 | PbDeviceType DeviceFactory::GetTypeForFile(const string& filename) const |
| 25 | { |
| 26 | if (const auto& it = EXTENSION_MAPPING.find(GetExtensionLowerCase(filename)); it != EXTENSION_MAPPING.end()) { |
| 27 | return it->second; |
| 28 | } |
| 29 | |
| 30 | if (const auto& it = DEVICE_MAPPING.find(filename); it != DEVICE_MAPPING.end()) { |
| 31 | return it->second; |
| 32 | } |
| 33 | |
| 34 | return UNDEFINED; |
| 35 | } |
| 36 | |
| 37 | shared_ptr<PrimaryDevice> DeviceFactory::CreateDevice(PbDeviceType type, int lun, const string& filename) const |
| 38 | { |
no outgoing calls