-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FS: Stub card SPI and some other things
- Loading branch information
1 parent
055dbc7
commit cc669d7
Showing
12 changed files
with
139 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#pragma once | ||
#include "archive_base.hpp" | ||
#include "result/result.hpp" | ||
|
||
using Result::HorizonResult; | ||
|
||
class CardSPIArchive : public ArchiveBase { | ||
public: | ||
CardSPIArchive(Memory& mem) : ArchiveBase(mem) {} | ||
std::string name() override { return "Card SPI"; } | ||
|
||
u64 getFreeBytes() override { | ||
Helpers::warn("Unimplemented GetFreeBytes for Card SPI archive"); | ||
return 0_MB; | ||
} | ||
|
||
HorizonResult createDirectory(const FSPath& path) override; | ||
HorizonResult createFile(const FSPath& path, u64 size) override; | ||
HorizonResult deleteFile(const FSPath& path) override; | ||
|
||
Rust::Result<ArchiveBase*, HorizonResult> openArchive(const FSPath& path) override; | ||
Rust::Result<DirectorySession, HorizonResult> openDirectory(const FSPath& path) override; | ||
|
||
FileDescriptor openFile(const FSPath& path, const FilePerms& perms) override; | ||
|
||
std::optional<u32> readFile(FileSession* file, u64 offset, u32 size, u32 dataPointer) override { | ||
Helpers::panic("Unimplemented ReadFile for Card SPI archive"); | ||
return {}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include <algorithm> | ||
#include <memory> | ||
|
||
#include "fs/archive_card_spi.hpp" | ||
|
||
namespace fs = std::filesystem; | ||
|
||
HorizonResult CardSPIArchive::createFile(const FSPath& path, u64 size) { | ||
Helpers::panic("[Card SPI] CreateFile not yet supported"); | ||
return Result::Success; | ||
} | ||
|
||
HorizonResult CardSPIArchive::deleteFile(const FSPath& path) { | ||
Helpers::panic("[Card SPI] Unimplemented DeleteFile"); | ||
return Result::Success; | ||
} | ||
|
||
HorizonResult CardSPIArchive::createDirectory(const FSPath& path) { | ||
Helpers::panic("[Card SPI] CreateDirectory not yet supported"); | ||
return Result::Success; | ||
} | ||
|
||
FileDescriptor CardSPIArchive::openFile(const FSPath& path, const FilePerms& perms) { | ||
Helpers::panic("[Card SPI] OpenFile not yet supported"); | ||
return FileError; | ||
} | ||
|
||
Rust::Result<ArchiveBase*, HorizonResult> CardSPIArchive::openArchive(const FSPath& path) { | ||
if (path.type != PathType::Empty) { | ||
Helpers::panic("Unimplemented path type for CardSPIArchive::OpenArchive"); | ||
} | ||
|
||
Helpers::warn("Unimplemented: Card SPI archive"); | ||
return Err(Result::FailurePlaceholder); | ||
} | ||
|
||
Rust::Result<DirectorySession, HorizonResult> CardSPIArchive::openDirectory(const FSPath& path) { | ||
Helpers::panic("[Card SPI] OpenDirectory not yet supported"); | ||
return Err(Result::FailurePlaceholder); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters