blob: 1b91b888b58f938692be8a8246afc4acf737d315 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#ifndef MENU_H_3F6E62B3
#define MENU_H_3F6E62B3
#include <memory>
#include <string>
#include <vector>
enum class MenuType {
Command
};
struct MenuItem {
MenuType type = MenuType::Command;
std::string text;
};
class MenuBuilder {
public:
MenuBuilder& Command(std::string text) {
result_.type = MenuType::Command;
result_.text = std::move(text);
return *this;
}
MenuItem Build() const {
return result_;
}
private:
MenuItem result_;
};
std::vector<MenuItem> CreateMenu(const std::vector<MenuBuilder>& builders);
#endif /* end of include guard: MENU_H_3F6E62B3 */
|