am: Move IStorageAccessor to header and update backing buffer

Writes to an AM::IStorage object through an IStorageAccessor will now be preserved once the accessor is destroyed.
This commit is contained in:
Zach Hilman
2018-11-09 20:04:07 -05:00
parent 76d515327b
commit c7b6c9de9c
2 changed files with 62 additions and 64 deletions

View File

@ -155,6 +155,32 @@ private:
std::shared_ptr<AppletMessageQueue> msg_queue;
};
class IStorage final : public ServiceFramework<IStorage> {
public:
explicit IStorage(std::vector<u8> buffer);
const std::vector<u8>& GetData() const;
private:
std::vector<u8> buffer;
void Open(Kernel::HLERequestContext& ctx);
friend class IStorageAccessor;
};
class IStorageAccessor final : public ServiceFramework<IStorageAccessor> {
public:
explicit IStorageAccessor(IStorage& backing);
private:
IStorage& backing;
void GetSize(Kernel::HLERequestContext& ctx);
void Write(Kernel::HLERequestContext& ctx);
void Read(Kernel::HLERequestContext& ctx);
};
class ILibraryAppletCreator final : public ServiceFramework<ILibraryAppletCreator> {
public:
ILibraryAppletCreator();