Skip to content

Commit e23a0c0

Browse files
committed
Update Text.h
1 parent a900d0d commit e23a0c0

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

src/utils/Text.h

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -513,16 +513,28 @@ class Text : public Printable {
513513
// ========================== CONVERT ==========================
514514

515515
// Вывести в String строку. Вернёт false при неудаче
516-
bool toString(String& s, bool decodeUnicode = false) const {
516+
bool toString(String& s) const {
517+
s = "";
518+
return addString(s);
519+
}
520+
521+
// Вывести в String строку. Вернёт false при неудаче
522+
bool toString(String& s, bool decodeUnicode) const {
517523
s = "";
518524
return addString(s, decodeUnicode);
519525
}
520526

521527
// Получить как String строку
522-
String toString(bool decodeUnicode = false) const {
523-
if (!valid() || !_len) return String();
528+
String toString() const {
529+
String s;
530+
addString(s);
531+
return s;
532+
}
533+
534+
// Получить как String строку
535+
String toString(bool decodeUnicode) const {
524536
String s;
525-
toString(s, decodeUnicode);
537+
addString(s, decodeUnicode);
526538
return s;
527539
}
528540

0 commit comments

Comments
 (0)