mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-05 09:25:05 +01:00
Implement IDirectory::GetEntryCount
This commit is contained in:
parent
c15b3a8d40
commit
0c11d9e294
@ -40,7 +40,14 @@ namespace skyline::service::fssrv {
|
||||
span(outputEntries[i].name).copy_from(entry.name);
|
||||
}
|
||||
|
||||
remainingReadCount += i;
|
||||
response.Push<u64>(i);
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
Result IDirectory::GetEntryCount(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
||||
auto entries{backing->Read()};
|
||||
response.Push<u64>(entries.size() - remainingReadCount);
|
||||
return {};
|
||||
}
|
||||
}
|
@ -17,6 +17,7 @@ namespace skyline::service::fssrv {
|
||||
private:
|
||||
std::shared_ptr<vfs::Directory> backing; //!< Backing directory of the IDirectory
|
||||
std::shared_ptr<vfs::FileSystem> backingFs; //!< Backing filesystem of the IDirectory
|
||||
u32 remainingReadCount{};
|
||||
|
||||
public:
|
||||
IDirectory(std::shared_ptr<vfs::Directory> backing, std::shared_ptr<vfs::FileSystem> backingFs, const DeviceState &state, ServiceManager &manager);
|
||||
@ -26,8 +27,14 @@ namespace skyline::service::fssrv {
|
||||
*/
|
||||
Result Read(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
|
||||
|
||||
/**
|
||||
* @url https://switchbrew.org/wiki/Filesystem_services#GetEntryCount
|
||||
*/
|
||||
Result GetEntryCount(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
|
||||
|
||||
SERVICE_DECL(
|
||||
SFUNC(0x0, IDirectory, Read),
|
||||
SFUNC(0x1, IDirectory, GetEntryCount)
|
||||
)
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user