Fix indentation and namespace names

This commit is contained in:
Martin Hrubý (hrubymar10) 2018-08-10 23:08:26 +02:00 committed by Jyrki Vesterinen
parent f551fdc378
commit b36295ca9b
4 changed files with 22 additions and 18 deletions

View file

@ -16,9 +16,13 @@
#include "battery_info.hpp"
namespace apple_battery_info {
namespace desktop {
namespace battery_info {
namespace apple {
bool does_device_have_battery();
double get_battery_percentage();
} // end namespace apple_battery_info
} // end namespace apple
} // end namespace battery_info
} // end namespace desktop

View file

@ -33,7 +33,9 @@
#endif
namespace apple_battery_info {
namespace desktop {
namespace battery_info {
namespace apple {
bool does_device_have_battery() {
#if defined(__IPHONEOS__)
@ -98,6 +100,8 @@ double get_battery_percentage() {
#endif
}
} // end namespace apple_battery_info
} // end namespace apple
} // end namespace battery_info
} // end namespace desktop
#endif //end __APPLE__

View file

@ -23,17 +23,16 @@
#endif
namespace desktop {
namespace battery_info {
bool does_device_have_battery()
{
#if defined(_WIN32)
return windows_battery_info::does_device_have_battery();
#elif defined(__APPLE__)
return apple_battery_info::does_device_have_battery();
return desktop::battery_info::apple::does_device_have_battery();
#else
return false;
return false;
#endif
}
@ -42,12 +41,11 @@ double get_battery_percentage()
#if defined(_WIN32)
return windows_battery_info::get_battery_percentage();
#elif defined(__APPLE__)
return apple_battery_info::get_battery_percentage();
return desktop::battery_info::apple::get_battery_percentage();
#else
return -1;
return -1;
#endif
}
} // end namespace battery_info
} // end namespace desktop

View file

@ -15,14 +15,12 @@
#pragma once
namespace desktop {
namespace battery_info {
/// @return true if the device has a battery, false otherwise.
bool does_device_have_battery();
/// @return battery charge as a number between 0 and 100.
double get_battery_percentage();
} // end namespace battery_info
} // end namespace desktop