mirror of
https://github.com/akuker/RASCSI.git
synced 2024-12-21 23:29:39 +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
50 lines
962 B
C++
50 lines
962 B
C++
//---------------------------------------------------------------------------
|
|
//
|
|
// SCSI Target Emulator RaSCSI Reloaded
|
|
// for Raspberry Pi
|
|
//
|
|
// Copyright (C) 2022 Uwe Seimet
|
|
//
|
|
//---------------------------------------------------------------------------
|
|
|
|
#include "rascsi_interface.pb.h"
|
|
#include <string>
|
|
#include <unordered_map>
|
|
|
|
using namespace std;
|
|
using namespace rascsi_interface;
|
|
|
|
class RasctlParser
|
|
{
|
|
|
|
public:
|
|
|
|
RasctlParser() = default;
|
|
~RasctlParser() = default;
|
|
|
|
PbOperation ParseOperation(const string&) const;
|
|
PbDeviceType ParseType(const string&) const;
|
|
|
|
private:
|
|
|
|
unordered_map<int, PbOperation> operations = {
|
|
{ 'a', ATTACH },
|
|
{ 'd', DETACH },
|
|
{ 'i', INSERT },
|
|
{ 'e', EJECT },
|
|
{ 'p', PROTECT },
|
|
{ 'u', UNPROTECT }
|
|
};
|
|
|
|
unordered_map<int, PbDeviceType> device_types = {
|
|
{ 'b', SCBR },
|
|
{ 'c', SCCD },
|
|
{ 'd', SCDP },
|
|
{ 'h', SCHD },
|
|
{ 'l', SCLP },
|
|
{ 'm', SCMO },
|
|
{ 'r', SCRM },
|
|
{ 's', SCHS }
|
|
};
|
|
};
|