mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
Added helper methods for writing numbers into HTMLBuilder.
This commit is contained in:
parent
aaa48e390b
commit
7fecc3e9ff
@ -1731,6 +1731,42 @@ HTMLBuilder *HTMLBuilder::w(const String &val) {
|
||||
return this;
|
||||
}
|
||||
|
||||
HTMLBuilder *HTMLBuilder::wn(const double val, int p_decimals) {
|
||||
write_tag();
|
||||
|
||||
result += String::num(val, p_decimals);
|
||||
|
||||
return this;
|
||||
}
|
||||
HTMLBuilder *HTMLBuilder::wns(const double val) {
|
||||
write_tag();
|
||||
|
||||
result += String::num_scientific(val);
|
||||
|
||||
return this;
|
||||
}
|
||||
HTMLBuilder *HTMLBuilder::wr(const double val, const bool p_trailing) {
|
||||
write_tag();
|
||||
|
||||
result += String::num_real(val, p_trailing);
|
||||
|
||||
return this;
|
||||
}
|
||||
HTMLBuilder *HTMLBuilder::wi(const int64_t val, const int base, const bool capitalize_hex) {
|
||||
write_tag();
|
||||
|
||||
result += String::num_int64(val, base, capitalize_hex);
|
||||
|
||||
return this;
|
||||
}
|
||||
HTMLBuilder *HTMLBuilder::wui(const uint64_t val, const int base, const bool capitalize_hex) {
|
||||
write_tag();
|
||||
|
||||
result += String::num_uint64(val, base, capitalize_hex);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
//TODO!
|
||||
HTMLBuilder *HTMLBuilder::we(const String &val) {
|
||||
printf("HTMLBuilder::write_excaped NYI!");
|
||||
|
@ -177,9 +177,9 @@ public:
|
||||
HTMLTag *wbr();
|
||||
|
||||
//closing tags c prefix means close
|
||||
//Note simple tags should not have these like <br>
|
||||
//Note that I might have a few that shouldn't be here, those will be removed as I find them
|
||||
HTMLBuilder *ca();
|
||||
//Note simple tags should not have these like <br>
|
||||
//Note that I might have a few that shouldn't be here, those will be removed as I find them
|
||||
HTMLBuilder *ca();
|
||||
HTMLBuilder *cabbr();
|
||||
HTMLBuilder *cacronym();
|
||||
HTMLBuilder *caddress();
|
||||
@ -215,7 +215,7 @@ public:
|
||||
HTMLBuilder *cdiv();
|
||||
HTMLBuilder *cdl();
|
||||
HTMLBuilder *cdt();
|
||||
|
||||
|
||||
HTMLBuilder *cem();
|
||||
HTMLBuilder *cembed();
|
||||
HTMLBuilder *cfieldset();
|
||||
@ -308,9 +308,16 @@ public:
|
||||
|
||||
void f();
|
||||
|
||||
//write
|
||||
//write
|
||||
HTMLBuilder *w(const String &val);
|
||||
//write_escaped
|
||||
|
||||
HTMLBuilder *wn(const double val, int p_decimals = -1);
|
||||
HTMLBuilder *wns(const double val);
|
||||
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);
|
||||
|
||||
//write_escaped
|
||||
HTMLBuilder *we(const String &val);
|
||||
|
||||
HTMLBuilder *write_tag();
|
||||
|
Loading…
Reference in New Issue
Block a user