Various command improvements
This commit is contained in:
@@ -24,70 +24,39 @@
|
||||
namespace sts::ncm {
|
||||
|
||||
class IContentStorage : public IServiceObject {
|
||||
protected:
|
||||
enum class CommandId {
|
||||
GeneratePlaceHolderId = 0,
|
||||
CreatePlaceHolder = 1,
|
||||
DeletePlaceHolder = 2,
|
||||
HasPlaceHolder = 3,
|
||||
WritePlaceHolder = 4,
|
||||
Register = 5,
|
||||
Delete = 6,
|
||||
Has = 7,
|
||||
GetPath = 8,
|
||||
GetPlaceHolderPath = 9,
|
||||
CleanupAllPlaceHolder = 10,
|
||||
ListPlaceHolder = 11,
|
||||
GetContentCount = 12,
|
||||
ListContentId = 13,
|
||||
GetSizeFromContentId = 14,
|
||||
DisableForcibly = 15,
|
||||
RevertToPlaceHolder = 16,
|
||||
SetPlaceHolderSize = 17,
|
||||
ReadContentIdFile = 18,
|
||||
GetRightsIdFromPlaceHolderId = 19,
|
||||
GetRightsIdFromContentId = 20,
|
||||
WriteContentForDebug = 21,
|
||||
GetFreeSpaceSize = 22,
|
||||
GetTotalSpaceSize = 23,
|
||||
FlushPlaceHolder = 24,
|
||||
GetSizeFromPlaceHolderId = 25,
|
||||
RepairInvalidFileAttribute = 26,
|
||||
GetRightsIdFromPlaceHolderIdWithCache = 27,
|
||||
};
|
||||
protected:
|
||||
char root_path[FS_MAX_PATH-1];
|
||||
MakeContentPathFunc make_content_path_func;
|
||||
bool disabled;
|
||||
public:
|
||||
virtual Result GeneratePlaceHolderId(Out<PlaceHolderId> out) = 0;
|
||||
virtual Result CreatePlaceHolder(PlaceHolderId placeholder_id, ContentId content_id, u64 size) = 0;
|
||||
virtual Result DeletePlaceHolder(PlaceHolderId placeholder_id) = 0;
|
||||
virtual Result HasPlaceHolder(Out<bool> out, PlaceHolderId placeholder_id) = 0;
|
||||
virtual Result WritePlaceHolder(PlaceHolderId placeholder_id, u64 offset, InBuffer<u8> data) = 0;
|
||||
virtual Result Register(PlaceHolderId placeholder_id, ContentId content_id) = 0;
|
||||
virtual Result Delete(ContentId content_id) = 0;
|
||||
virtual Result Has(Out<bool> out, ContentId content_id) = 0;
|
||||
virtual Result GetPath(OutPointerWithServerSize<lr::Path, 0x1> out, ContentId content_id) = 0;
|
||||
virtual Result GetPlaceHolderPath(OutPointerWithServerSize<lr::Path, 0x1> out, PlaceHolderId placeholder_id) = 0;
|
||||
virtual Result CleanupAllPlaceHolder() = 0;
|
||||
virtual Result ListPlaceHolder(Out<u32> out_count, OutBuffer<PlaceHolderId> out_buf) = 0;
|
||||
virtual Result GetContentCount(Out<u32> out_count) = 0;
|
||||
virtual Result ListContentId(Out<u32> out_count, OutBuffer<ContentId> out_buf, u32 start_offset) = 0;
|
||||
virtual Result GetSizeFromContentId(Out<u64> out_size, ContentId content_id) = 0;
|
||||
virtual Result DisableForcibly() = 0;
|
||||
virtual Result RevertToPlaceHolder(PlaceHolderId placeholder_id, ContentId old_content_id, ContentId new_content_id) = 0;
|
||||
virtual Result SetPlaceHolderSize(PlaceHolderId placeholder_id, u64 size) = 0;
|
||||
virtual Result ReadContentIdFile(OutBuffer<u8> buf, ContentId content_id, u64 offset) = 0;
|
||||
virtual Result GetRightsIdFromPlaceHolderId(Out<FsRightsId> out_rights_id, Out<u64> out_key_generation, PlaceHolderId placeholder_id) = 0;
|
||||
virtual Result GetRightsIdFromContentId(Out<FsRightsId> out_rights_id, Out<u64> out_key_generation, ContentId content_id) = 0;
|
||||
virtual Result WriteContentForDebug(ContentId content_id, u64 offset, InBuffer<u8> data) = 0;
|
||||
virtual Result GetFreeSpaceSize(Out<u64> out_size) = 0;
|
||||
virtual Result GetTotalSpaceSize(Out<u64> out_size) = 0;
|
||||
virtual Result FlushPlaceHolder() = 0;
|
||||
virtual Result GetSizeFromPlaceHolderId(Out<u64> out, PlaceHolderId placeholder_id) = 0;
|
||||
virtual Result RepairInvalidFileAttribute() = 0;
|
||||
virtual Result GetRightsIdFromPlaceHolderIdWithCache(Out<FsRightsId> out_rights_id, Out<u64> out_key_generation, PlaceHolderId placeholder_id, ContentId cache_content_id) = 0;
|
||||
virtual Result GeneratePlaceHolderId(Out<PlaceHolderId> out);
|
||||
virtual Result CreatePlaceHolder(PlaceHolderId placeholder_id, ContentId content_id, u64 size);
|
||||
virtual Result DeletePlaceHolder(PlaceHolderId placeholder_id);
|
||||
virtual Result HasPlaceHolder(Out<bool> out, PlaceHolderId placeholder_id);
|
||||
virtual Result WritePlaceHolder(PlaceHolderId placeholder_id, u64 offset, InBuffer<u8> data);
|
||||
virtual Result Register(PlaceHolderId placeholder_id, ContentId content_id);
|
||||
virtual Result Delete(ContentId content_id);
|
||||
virtual Result Has(Out<bool> out, ContentId content_id);
|
||||
virtual Result GetPath(OutPointerWithServerSize<lr::Path, 0x1> out, ContentId content_id);
|
||||
virtual Result GetPlaceHolderPath(OutPointerWithServerSize<lr::Path, 0x1> out, PlaceHolderId placeholder_id);
|
||||
virtual Result CleanupAllPlaceHolder();
|
||||
virtual Result ListPlaceHolder(Out<u32> out_count, OutBuffer<PlaceHolderId> out_buf);
|
||||
virtual Result GetContentCount(Out<u32> out_count);
|
||||
virtual Result ListContentId(Out<u32> out_count, OutBuffer<ContentId> out_buf, u32 start_offset);
|
||||
virtual Result GetSizeFromContentId(Out<u64> out_size, ContentId content_id);
|
||||
virtual Result DisableForcibly();
|
||||
virtual Result RevertToPlaceHolder(PlaceHolderId placeholder_id, ContentId old_content_id, ContentId new_content_id);
|
||||
virtual Result SetPlaceHolderSize(PlaceHolderId placeholder_id, u64 size);
|
||||
virtual Result ReadContentIdFile(OutBuffer<u8> buf, ContentId content_id, u64 offset);
|
||||
virtual Result GetRightsIdFromPlaceHolderId(Out<FsRightsId> out_rights_id, Out<u64> out_key_generation, PlaceHolderId placeholder_id);
|
||||
virtual Result GetRightsIdFromContentId(Out<FsRightsId> out_rights_id, Out<u64> out_key_generation, ContentId content_id);
|
||||
virtual Result WriteContentForDebug(ContentId content_id, u64 offset, InBuffer<u8> data);
|
||||
virtual Result GetFreeSpaceSize(Out<u64> out_size);
|
||||
virtual Result GetTotalSpaceSize(Out<u64> out_size);
|
||||
virtual Result FlushPlaceHolder();
|
||||
virtual Result GetSizeFromPlaceHolderId(Out<u64> out, PlaceHolderId placeholder_id);
|
||||
virtual Result RepairInvalidFileAttribute();
|
||||
virtual Result GetRightsIdFromPlaceHolderIdWithCache(Out<FsRightsId> out_rights_id, Out<u64> out_key_generation, PlaceHolderId placeholder_id, ContentId cache_content_id);
|
||||
public:
|
||||
DEFINE_SERVICE_DISPATCH_TABLE {};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user