summaryrefslogtreecommitdiffstats
path: root/src/core/loader/kip.h
blob: 63f66e85c1a23f3bf27a27d6b76c0f3b4ff29bdf (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
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include "core/loader/loader.h"

namespace Core {
class System;
}

namespace FileSys {
class KIP;
}

namespace Loader {

class AppLoader_KIP final : public AppLoader {
public:
    explicit AppLoader_KIP(FileSys::VirtualFile file);
    ~AppLoader_KIP() override;

    /**
     * Identifies whether or not the given file is a KIP.
     *
     * @param in_file The file to identify.
     *
     * @return FileType::KIP if found, or FileType::Error if unknown.
     */
    static FileType IdentifyType(const FileSys::VirtualFile& in_file);

    FileType GetFileType() const override;

    LoadResult Load(Kernel::KProcess& process, Core::System& system) override;

private:
    std::unique_ptr<FileSys::KIP> kip;
};

} // namespace Loader