aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/hle/service/fs_user.h
blob: 44f89ef4ac638545822a10af8ae914592b3ac763 (plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright 2014 Citra Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.

#pragma once

#include "core/hle/service/service.h"

////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace FS_User

namespace FS_User {

class FS_Path {
public:
    // Command to access archive file
    enum LowPathType : u32 {
        Invalid = 0,
        Empty   = 1,
        Binary  = 2,
        Char    = 3,
        Wchar   = 4
    };

    FS_Path(LowPathType type, u32 size, u32 pointer);

    LowPathType GetType() const;

    const std::vector<u8>& GetBinary() const;
    const std::string& GetString() const;
    const std::u16string& GetU16Str() const;

    std::string AsString();
    std::u16string AsU16Str();

private:
    LowPathType type;
    std::vector<u8> binary;
    std::string string;
    std::u16string u16str;
};

/// Interface to "fs:USER" service
class Interface : public Service::Interface {
public:

    Interface();

    ~Interface();

    /**
     * Gets the string port name used by CTROS for the service
     * @return Port name of service
     */
    std::string GetPortName() const override {
        return "fs:USER";
    }
};

} // namespace