summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/sdmc_factory.h
blob: ee69ccd07016dfe1fdf015975263684fdc95def0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include <memory>
#include "core/file_sys/vfs/vfs_types.h"
#include "core/hle/result.h"

namespace FileSys {

class RegisteredCache;
class PlaceholderCache;

/// File system interface to the SDCard archive
class SDMCFactory {
public:
    explicit SDMCFactory(VirtualDir sd_dir_, VirtualDir sd_mod_dir_);
    ~SDMCFactory();

    VirtualDir Open() const;

    VirtualDir GetSDMCModificationLoadRoot(u64 title_id) const;
    VirtualDir GetSDMCContentDirectory() const;

    RegisteredCache* GetSDMCContents() const;
    PlaceholderCache* GetSDMCPlaceholder() const;

    VirtualDir GetImageDirectory() const;

    u64 GetSDMCFreeSpace() const;
    u64 GetSDMCTotalSpace() const;

private:
    VirtualDir sd_dir;
    VirtualDir sd_mod_dir;

    std::unique_ptr<RegisteredCache> contents;
    std::unique_ptr<PlaceholderCache> placeholder;
};

} // namespace FileSys