forked from rileytestut/AltServer-Windows
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDevice.hpp
More file actions
executable file
·75 lines (56 loc) · 1.47 KB
/
Device.hpp
File metadata and controls
executable file
·75 lines (56 loc) · 1.47 KB
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
//
// Device.hpp
// AltSign-Windows
//
// Created by Riley Testut on 8/10/19.
// Copyright © 2019 Riley Testut. All rights reserved.
//
#ifndef Device_hpp
#define Device_hpp
/* The classes below are exported */
#pragma GCC visibility push(default)
#include <optional>
#include <string>
#include <iostream>
#include <plist/plist.h>
struct OperatingSystemVersion
{
int majorVersion;
int minorVersion;
int patchVersion;
OperatingSystemVersion(int major, int minor, int patch);
OperatingSystemVersion(std::string string);
std::string stringValue() const;
bool operator <(const OperatingSystemVersion& osVersion) const;
};
class Device
{
public:
enum Type
{
iPhone = 1 << 1,
iPad = 1 << 2,
AppleTV = 1 << 3,
None = 0,
All = (iPhone | iPad | AppleTV)
};
Device();
~Device();
Device(std::string name, std::string identifier, Device::Type type);
Device(plist_t plist) /* throws */;
std::string identifier() const;
Device::Type type() const;
std::string name() const;
void setName(std::string name);
void setOSVersion(OperatingSystemVersion version);
OperatingSystemVersion osVersion() const;
friend std::ostream& operator<<(std::ostream& os, const Device& device);
private:
std::string _name;
std::string _identifier;
Device::Type _type;
OperatingSystemVersion _osVersion;
};
std::optional<std::string> ALTOperatingSystemNameForDeviceType(Device::Type deviceType);
#pragma GCC visibility pop
#endif /* Device_hpp */