diff options
author | Alex Zolotarev <alex@maps.me> | 2016-02-10 23:04:23 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:17:06 +0300 |
commit | e821eadeee820b77bfeffd99e9e077e6686995e4 (patch) | |
tree | ade54ba58c9a8e22f1264ed265ba09517cc21036 | |
parent | 5557766bf380bd5d12bd11b6bf9c56217b04e736 (diff) |
Introduced yes/no/unknown value enum.
-rw-r--r-- | editor/editor.pro | 1 | ||||
-rw-r--r-- | editor/yes_no_unknown.hpp | 27 |
2 files changed, 28 insertions, 0 deletions
diff --git a/editor/editor.pro b/editor/editor.pro index 95b7d1a640..c0eb16cd73 100644 --- a/editor/editor.pro +++ b/editor/editor.pro @@ -25,3 +25,4 @@ HEADERS += \ server_api.hpp \ ui2oh.hpp \ xml_feature.hpp \ + yes_no_unknown.hpp \ diff --git a/editor/yes_no_unknown.hpp b/editor/yes_no_unknown.hpp new file mode 100644 index 0000000000..c6df462fd4 --- /dev/null +++ b/editor/yes_no_unknown.hpp @@ -0,0 +1,27 @@ +#pragma once + +#include "std/cstdint.hpp" +#include "std/string.hpp" + +/// Used to store and edit 3-state OSM information, for example, +/// "This place has internet", "does not have", or "it's not specified yet". +/// Explicit values are given for easier reuse in Java code. +namespace osm +{ +enum YesNoUnknown +{ + Unknown = 0, + Yes = 1, + No = 2 +}; + +inline string DebugPrint(YesNoUnknown value) +{ + switch (value) + { + case Unknown: return "Unknown"; + case Yes: return "Yes"; + case No: return "No"; + } +} +} // namespace osm |