-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfile.h
94 lines (49 loc) · 1.36 KB
/
file.h
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
// APK - Copyright (c) 2024 by Robin Southern. https://github.com/betajaen/apk
// Licensed under the MIT License; see LICENSE file.
#pragma once
#include "pod.h"
#include "consts.h"
namespace apk { namespace fs {
void setProgramDir(const char* path);
const char* getProgramDir();
typedef bool(*DirFn)(char* path, void* user);
void Dir(const char* path, const char* extension, DirFn cb, void* user);
}}
namespace apk { namespace path {
enum class PathType {
None,
File,
DrawerVolume
};
PathType test(const char* path);
}}
namespace apk {
class FileImpl;
class ReadFile {
FileImpl* m_impl;
public:
ReadFile();
~ReadFile();
bool open(const char*);
bool close();
bool isOpen() const;
uint32 size() const;
bool seek(int32 where, int32 mode = kSEEK_SET);
uint32 read(void* data, uint32 size);
int16 readSint16BE();
int32 readSint32BE();
uint16 readUint16BE();
uint32 readUint32BE();
static bool exists(const char*);
};
class AppendFile {
FileImpl* m_impl;
public:
AppendFile();
~AppendFile();
bool open(const char*);
bool close();
bool isOpen() const;
uint32 write(void* data, uint32 size);
};
}