mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-29 17:05:29 +03: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);
|
span(outputEntries[i].name).copy_from(entry.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
remainingReadCount += i;
|
||||||
response.Push<u64>(i);
|
response.Push<u64>(i);
|
||||||
return {};
|
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:
|
private:
|
||||||
std::shared_ptr<vfs::Directory> backing; //!< Backing directory of the IDirectory
|
std::shared_ptr<vfs::Directory> backing; //!< Backing directory of the IDirectory
|
||||||
std::shared_ptr<vfs::FileSystem> backingFs; //!< Backing filesystem of the IDirectory
|
std::shared_ptr<vfs::FileSystem> backingFs; //!< Backing filesystem of the IDirectory
|
||||||
|
u32 remainingReadCount{};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
IDirectory(std::shared_ptr<vfs::Directory> backing, std::shared_ptr<vfs::FileSystem> backingFs, const DeviceState &state, ServiceManager &manager);
|
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);
|
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(
|
SERVICE_DECL(
|
||||||
SFUNC(0x0, IDirectory, Read),
|
SFUNC(0x0, IDirectory, Read),
|
||||||
|
SFUNC(0x1, IDirectory, GetEntryCount)
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user