-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathArgstring.hpp
More file actions
91 lines (73 loc) · 2.74 KB
/
Argstring.hpp
File metadata and controls
91 lines (73 loc) · 2.74 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//
// AmigaOS MUI C++ wrapper
//
// (c) 2022-2026 TDolphin
//
#pragma once
#include "mui.hpp"
#ifdef MUIC_Argstring
#include "Group.hpp"
namespace MUI
{
/// @brief Build dynamic GUIs from ReadArgs() templates.
class Argstring : public Group
{
public:
explicit Argstring(Object *pMuiObject)
: Group(pMuiObject)
{
}
Argstring(const Root &root)
: Group(root.muiObject())
{
}
// instanceOf
const static std::string className;
static inline bool instanceOf(Object *pMuiObject)
{
return MUI::instanceOf(pMuiObject, className.c_str());
}
static inline bool instanceOf(const Root &object)
{
return MUI::instanceOf(object.muiObject(), className.c_str());
}
// is/get/set (attributes), all setters return object reference
/// @brief [ @b MUIA_Argstring_Contents ] Return current contents string.
std::string getContents() const;
/// @brief [ @b MUIA_Argstring_Template ] Return current template string.
std::string getTemplate() const;
/// @brief [ @b MUIA_Argstring_Contents ] Set contents string.
Argstring &setContents(const char *contents);
/// @brief [ @b MUIA_Argstring_Contents ] Set contents string.
Argstring &setContents(const std::string &contents);
/// @brief [ @b MUIA_Argstring_Template ] Set template string.
Argstring &setTemplate(const char *templateValue);
/// @brief [ @b MUIA_Argstring_Template ] Set template string.
Argstring &setTemplate(const std::string &templateValue);
};
template <typename T, typename U> class ArgstringBuilderTemplate : public GroupBuilderTemplate<T, U>
{
public:
ArgstringBuilderTemplate(const std::string &uniqueId = MUI::EmptyUniqueId, const std::string &muiClassName = MUIC_Argstring)
: GroupBuilderTemplate<T, U>(uniqueId, muiClassName)
{
}
/// @brief [ @b MUIA_Argstring_Contents ] Set initial contents string.
T &tagContents(const char *contents);
/// @brief [ @b MUIA_Argstring_Contents ] Set initial contents string.
T &tagContents(const std::string &contents);
/// @brief [ @b MUIA_Argstring_Template ] Set initial template string.
T &tagTemplate(const char *templateValue);
/// @brief [ @b MUIA_Argstring_Template ] Set initial template string.
T &tagTemplate(const std::string &templateValue);
};
class ArgstringBuilder : public ArgstringBuilderTemplate<ArgstringBuilder, Argstring>
{
public:
ArgstringBuilder();
};
}
#define MUI_ARGSTRING_TPP_INCLUDE
#include "Argstring.tpp"
#undef MUI_ARGSTRING_TPP_INCLUDE
#endif