color collection, now only CSS colors

PIVariantTypes::Color from/to string (with CSS names)
This commit is contained in:
2022-12-05 19:16:48 +03:00
parent b25ecf42fb
commit cf5284a244
9 changed files with 326 additions and 33 deletions

View File

@@ -522,6 +522,27 @@ PIString PIString::simplified() const {
}
PIString & PIString::mask(const PIString & symbols, PIChar mc) {
for (int i = 0; i < size_s(); ++i)
if (symbols.contains(at(i))) {
insert(i, mc);
++i;
}
return *this;
}
PIString & PIString::unmask(const PIString & symbols, const PIChar mc) {
for (int i = 0; i < size_s() - 1; ++i)
if (at(i) == mc) {
if (symbols.contains(at(i + 1))) {
remove(i);
}
}
return *this;
}
PIString & PIString::operator +=(const char * str) {
if (!str) return *this;
appendFromChars(str, -1, __syslocname__);