mirror of
https://github.com/akuker/RASCSI.git
synced 2024-11-22 16:33:17 +00:00
08194af424
- Moved C++ code to cpp/ from src/raspberrypi - Related updates to Makefile, easyinstall.sh, and the github build rules - Removed the native X68k C code in src/x68k from the repo
32 lines
881 B
C++
32 lines
881 B
C++
//---------------------------------------------------------------------------
|
|
//
|
|
// SCSI Target Emulator RaSCSI Reloaded
|
|
// for Raspberry Pi
|
|
//
|
|
// Copyright (C) 2022 Uwe Seimet
|
|
//
|
|
//---------------------------------------------------------------------------
|
|
|
|
#include "rasctl_parser.h"
|
|
|
|
|
|
PbOperation RasctlParser::ParseOperation(const string& operation) const
|
|
{
|
|
const auto& it = operations.find(tolower(operation[0]));
|
|
return it != operations.end() ? it->second : NO_OPERATION;
|
|
}
|
|
|
|
PbDeviceType RasctlParser::ParseType(const string& type) const
|
|
{
|
|
string t = type;
|
|
transform(t.begin(), t.end(), t.begin(), ::toupper);
|
|
|
|
if (PbDeviceType parsed_type; PbDeviceType_Parse(t, &parsed_type)) {
|
|
return parsed_type;
|
|
}
|
|
|
|
// Handle convenience device types (shortcuts)
|
|
const auto& it = device_types.find(tolower(type[0]));
|
|
return it != device_types.end() ? it->second : UNDEFINED;
|
|
}
|