refactor: convert C++ enums to C++11 enum classes (#18087)

This commit is contained in:
Milan Burda 2019-05-03 20:11:41 +02:00 committed by Alexey Kuzmin
parent a59dc56fa6
commit c25c31e018
36 changed files with 199 additions and 204 deletions

View file

@ -25,18 +25,19 @@ struct Converter<atom::TrayIcon::HighlightMode> {
static bool FromV8(v8::Isolate* isolate,
v8::Local<v8::Value> val,
atom::TrayIcon::HighlightMode* out) {
using HighlightMode = atom::TrayIcon::HighlightMode;
std::string mode;
if (ConvertFromV8(isolate, val, &mode)) {
if (mode == "always") {
*out = atom::TrayIcon::HighlightMode::ALWAYS;
*out = HighlightMode::ALWAYS;
return true;
}
if (mode == "selection") {
*out = atom::TrayIcon::HighlightMode::SELECTION;
*out = HighlightMode::SELECTION;
return true;
}
if (mode == "never") {
*out = atom::TrayIcon::HighlightMode::NEVER;
*out = HighlightMode::NEVER;
return true;
}
}