Add Service::isEnabled()

This commit is contained in:
Cruel
2015-08-22 23:13:16 -04:00
parent aa9b884df3
commit e43231932f
3 changed files with 13 additions and 1 deletions
+1
View File
@@ -19,6 +19,7 @@ class Service {
public:
static bool enable(ServiceName service);
static bool disable(ServiceName service);
static bool isEnabled(ServiceName service);
private:
static Uint16 m_enabledServices;
+8 -1
View File
@@ -8,8 +8,9 @@ namespace cpp3ds {
Uint16 Service::m_enabledServices = 0x0;
u32* Service::socBuffer = NULL;
bool Service::enable(ServiceName service) {
if (service & m_enabledServices)
if (isEnabled(service))
return true;
if (service == ALL)
@@ -36,6 +37,7 @@ bool Service::enable(ServiceName service) {
return false;
}
bool Service::disable(ServiceName service) {
if (service & ~m_enabledServices)
return true;
@@ -58,4 +60,9 @@ bool Service::disable(ServiceName service) {
}
}
bool Service::isEnabled(ServiceName service) {
return service & m_enabledServices;
}
} // namespace cpp3ds
+4
View File
@@ -10,4 +10,8 @@ namespace cpp3ds {
return true;
}
bool Service::isEnabled(ServiceName service) {
return true;
}
} // namespace cpp3ds