mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
Added new helper methods to HTMLBuilder.
This commit is contained in:
parent
7fcd38fff7
commit
80c3b97a6b
@ -48,6 +48,14 @@ HTMLTag *HTMLTag::value(const String &val) {
|
||||
return this;
|
||||
}
|
||||
|
||||
HTMLTag *HTMLTag::checked(const bool val) {
|
||||
if (val) {
|
||||
result += " checked";
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
HTMLTag *HTMLTag::method(const String &val) {
|
||||
attrib("method", val);
|
||||
|
||||
@ -1773,6 +1781,21 @@ HTMLBuilder *HTMLBuilder::wui(const uint64_t val, const int base, const bool cap
|
||||
return this;
|
||||
}
|
||||
|
||||
HTMLBuilder *HTMLBuilder::wbn(const bool val) {
|
||||
write_tag();
|
||||
|
||||
result += String::bool_num(val);
|
||||
|
||||
return this;
|
||||
}
|
||||
HTMLBuilder *HTMLBuilder::wbs(const bool val) {
|
||||
write_tag();
|
||||
|
||||
result += String::bool_str(val);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
//TODO!
|
||||
HTMLBuilder *HTMLBuilder::we(const String &val) {
|
||||
printf("HTMLBuilder::write_excaped NYI!");
|
||||
|
@ -19,6 +19,7 @@ public:
|
||||
HTMLTag *name(const String &val);
|
||||
HTMLTag *content(const String &val);
|
||||
HTMLTag *value(const String &val);
|
||||
HTMLTag *checked(const bool val = true);
|
||||
HTMLTag *method(const String &val);
|
||||
HTMLTag *action(const String &val);
|
||||
HTMLTag *type(const String &val);
|
||||
@ -317,6 +318,8 @@ public:
|
||||
HTMLBuilder *wr(const double val, const bool p_trailing = true);
|
||||
HTMLBuilder *wi(const int64_t val, const int base = 10, const bool capitalize_hex = false);
|
||||
HTMLBuilder *wui(const uint64_t val, const int base = 10, const bool capitalize_hex = false);
|
||||
HTMLBuilder *wbn(const bool val);
|
||||
HTMLBuilder *wbs(const bool val);
|
||||
|
||||
//write_escaped
|
||||
HTMLBuilder *we(const String &val);
|
||||
|
Loading…
Reference in New Issue
Block a user