2019-10-18 03:59:34 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#include <switch/services/fs.h>
|
|
|
|
#include <switch/services/ncm.h>
|
|
|
|
}
|
|
|
|
|
|
|
|
#include "nx/ipc/tin_ipc.h"
|
|
|
|
|
|
|
|
namespace nx::ncm
|
|
|
|
{
|
|
|
|
class ContentStorage final
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
NcmContentStorage m_contentStorage;
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Don't allow copying, or garbage may be closed by the destructor
|
|
|
|
ContentStorage& operator=(const ContentStorage&) = delete;
|
|
|
|
ContentStorage(const ContentStorage&) = delete;
|
|
|
|
|
|
|
|
ContentStorage(FsStorageId storageId);
|
|
|
|
~ContentStorage();
|
|
|
|
|
2019-10-25 01:33:41 +00:00
|
|
|
void CreatePlaceholder(const NcmContentId &placeholderId, const NcmContentId ®isteredId, size_t size);
|
|
|
|
void DeletePlaceholder(const NcmContentId &placeholderId);
|
|
|
|
void WritePlaceholder(const NcmContentId &placeholderId, u64 offset, void *buffer, size_t bufSize);
|
|
|
|
void Register(const NcmContentId &placeholderId, const NcmContentId ®isteredId);
|
|
|
|
void Delete(const NcmContentId ®isteredId);
|
|
|
|
bool Has(const NcmContentId ®isteredId);
|
|
|
|
std::string GetPath(const NcmContentId ®isteredId);
|
2019-10-18 03:59:34 +00:00
|
|
|
};
|
|
|
|
}
|