mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Convert the VFS protos to use enums rather than oneofs.
This commit is contained in:
@@ -177,30 +177,30 @@ Filesystem::Filesystem(std::shared_ptr<SectorInterface> sectors):
|
||||
std::unique_ptr<Filesystem> Filesystem::createFilesystem(
|
||||
const FilesystemProto& config, std::shared_ptr<SectorInterface> image)
|
||||
{
|
||||
switch (config.filesystem_case())
|
||||
switch (config.type())
|
||||
{
|
||||
case FilesystemProto::kBrother120:
|
||||
case FilesystemProto::BROTHER120:
|
||||
return Filesystem::createBrother120Filesystem(config, image);
|
||||
|
||||
case FilesystemProto::kAcorndfs:
|
||||
case FilesystemProto::ACORNDFS:
|
||||
return Filesystem::createAcornDfsFilesystem(config, image);
|
||||
|
||||
case FilesystemProto::kFatfs:
|
||||
case FilesystemProto::FATFS:
|
||||
return Filesystem::createFatFsFilesystem(config, image);
|
||||
|
||||
case FilesystemProto::kCpmfs:
|
||||
case FilesystemProto::CPMFS:
|
||||
return Filesystem::createCpmFsFilesystem(config, image);
|
||||
|
||||
case FilesystemProto::kAmigaffs:
|
||||
case FilesystemProto::AMIGAFFS:
|
||||
return Filesystem::createAmigaFfsFilesystem(config, image);
|
||||
|
||||
case FilesystemProto::kMachfs:
|
||||
case FilesystemProto::MACHFS:
|
||||
return Filesystem::createMacHfsFilesystem(config, image);
|
||||
|
||||
case FilesystemProto::kCbmfs:
|
||||
case FilesystemProto::CBMFS:
|
||||
return Filesystem::createCbmfsFilesystem(config, image);
|
||||
|
||||
case FilesystemProto::kProdos:
|
||||
case FilesystemProto::PRODOS:
|
||||
return Filesystem::createProdosFilesystem(config, image);
|
||||
|
||||
default:
|
||||
|
||||
@@ -59,20 +59,31 @@ message CbmfsProto
|
||||
|
||||
message ProdosProto {}
|
||||
|
||||
// NEXT_TAG: 10
|
||||
// NEXT_TAG: 11
|
||||
message FilesystemProto
|
||||
{
|
||||
oneof filesystem
|
||||
{
|
||||
AcornDfsProto acorndfs = 1;
|
||||
Brother120FsProto brother120 = 2;
|
||||
FatFsProto fatfs = 3;
|
||||
CpmFsProto cpmfs = 4;
|
||||
AmigaFfsProto amigaffs = 5;
|
||||
MacHfsProto machfs = 6;
|
||||
CbmfsProto cbmfs = 7;
|
||||
ProdosProto prodos = 8;
|
||||
enum FilesystemType {
|
||||
NOT_SET = 0;
|
||||
ACORNDFS = 1;
|
||||
BROTHER120 = 2;
|
||||
FATFS = 3;
|
||||
CPMFS = 4;
|
||||
AMIGAFFS = 5;
|
||||
MACHFS = 6;
|
||||
CBMFS = 7;
|
||||
PRODOS = 8;
|
||||
}
|
||||
|
||||
optional FilesystemType type = 10 [default = NOT_SET, (help) = "filesystem type"];
|
||||
|
||||
optional AcornDfsProto acorndfs = 1;
|
||||
optional Brother120FsProto brother120 = 2;
|
||||
optional FatFsProto fatfs = 3;
|
||||
optional CpmFsProto cpmfs = 4;
|
||||
optional AmigaFfsProto amigaffs = 5;
|
||||
optional MacHfsProto machfs = 6;
|
||||
optional CbmfsProto cbmfs = 7;
|
||||
optional ProdosProto prodos = 8;
|
||||
|
||||
optional SectorListProto sector_order = 9 [(help) = "specify the filesystem order of sectors"];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user