File: DefaultedFileAccess.h

package info (click to toggle)
megacmd 2.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 32,592 kB
  • sloc: cpp: 326,437; ansic: 34,524; python: 4,630; java: 3,965; sh: 2,869; objc: 2,459; makefile: 197; xml: 113
file content (128 lines) | stat: -rw-r--r-- 3,079 bytes parent folder | download
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/**
 * (c) 2019 by Mega Limited, Wellsford, New Zealand
 *
 * This file is part of the MEGA SDK - Client Access Engine.
 *
 * Applications using the MEGA API must present a valid application key
 * and comply with the the rules set forth in the Terms of Service.
 *
 * The MEGA SDK is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @copyright Simplified (2-clause) BSD License.
 *
 * You should have received a copy of the license along with this
 * program.
 */

#pragma once

#include <mega/filesystem.h>

#include "NotImplemented.h"

namespace mt {

using ::mega::FSLogging;

class DefaultedFileAccess: public mega::FileAccess
{
public:
    DefaultedFileAccess():
        mega::FileAccess{nullptr}
    {}

    virtual bool fopen(const ::mega::LocalPath&,
                       bool,
                       bool,
                       FSLogging,
                       ::mega::DirAccess* = nullptr,
                       bool = false,
                       bool = false,
                       ::mega::LocalPath* = nullptr) override
    {
        throw NotImplemented{__func__};
        return false;
    }

    void updatelocalname(const ::mega::LocalPath&, bool) override
    {
        throw NotImplemented{__func__};
    }

    virtual bool frawread(void*, unsigned long, m_off_t, bool, FSLogging, bool* = nullptr) override
    {
        throw NotImplemented{__func__};
        return false;
    }

    virtual bool openf(FSLogging) override
    {
        throw NotImplemented{__func__};
        return false;
    }

    virtual void fclose() override
    {
        throw NotImplemented{__func__};
    }

    virtual bool fwrite(const void*,
                        unsigned long,
                        m_off_t,
                        unsigned long* = nullptr,
                        bool* = nullptr) override
    {
        throw NotImplemented{__func__};
        return false;
    }

    virtual bool fstat(::mega::m_time_t&, m_off_t&) override
    {
        throw NotImplemented{__func__};
        return false;
    }

    virtual bool ftruncate(m_off_t = 0) override
    {
        throw NotImplemented{__func__};
        return false;
    }

    virtual bool setSparse() override
    {
        throw NotImplemented{__func__};
        return false;
    }

    virtual std::optional<std::pair<std::uint64_t, std::uint64_t>> getFileSize() const override
    {
        throw NotImplemented{__func__};
        return std::nullopt;
    }

    virtual bool sysread(void*, unsigned long, m_off_t, bool*) override
    {
        throw NotImplemented{__func__};
        return false;
    }

    virtual bool sysstat(::mega::m_time_t*, m_off_t*, FSLogging) override
    {
        throw NotImplemented{__func__};
    }

    virtual bool sysopen(bool, FSLogging) override
    {
        throw NotImplemented{__func__};
        return false;
    }

    virtual void sysclose() override
    {
        throw NotImplemented{__func__};
    }
};

} // mt