| 32 | } |
| 33 | |
| 34 | static std::string toString(Orientation orientation) { |
| 35 | switch (orientation) { |
| 36 | using enum Orientation; |
| 37 | case Portrait: |
| 38 | return "Portrait"; |
| 39 | case Landscape: |
| 40 | return "Landscape"; |
| 41 | case PortraitFlipped: |
| 42 | return "PortraitFlipped"; |
| 43 | case LandscapeFlipped: |
| 44 | return "LandscapeFlipped"; |
| 45 | default: |
| 46 | std::unreachable(); |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | static bool fromString(const std::string& str, Orientation& orientation) { |
| 51 | if (str == "Portrait") { |