aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/service/fs/directory.h
blob: 77956b1661a1ad24fae01499ccaa04c4328ec60b (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
// Copyright 2018 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

#pragma once

#include <memory>
#include "core/file_sys/archive_backend.h"
#include "core/hle/service/service.h"

namespace Service::FS {

class Directory final : public ServiceFramework<Directory> {
public:
    Directory(std::unique_ptr<FileSys::DirectoryBackend>&& backend, const FileSys::Path& path);
    ~Directory();

    std::string GetName() const {
        return "Directory: " + path.DebugStr();
    }

    FileSys::Path path;                                 ///< Path of the directory
    std::unique_ptr<FileSys::DirectoryBackend> backend; ///< File backend interface

protected:
    void Read(Kernel::HLERequestContext& ctx);
    void Close(Kernel::HLERequestContext& ctx);

private:
    Directory();

    template <class Archive>
    void serialize(Archive& ar, const unsigned int);
    friend class boost::serialization::access;
};

} // namespace Service::FS

BOOST_CLASS_EXPORT_KEY(Service::FS::Directory)