MCPcopy Create free account
hub / github.com/PiSCSI/piscsi / GetTypeForFile

Method GetTypeForFile

cpp/devices/device_factory.cpp:24–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22using namespace piscsi_util;
23
24PbDeviceType 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
37shared_ptr<PrimaryDevice> DeviceFactory::CreateDevice(PbDeviceType type, int lun, const string& filename) const
38{

Callers 2

TESTFunction · 0.80
GetImageFileMethod · 0.80

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.64