8
8
*
9
9
* v1.2.8
10
10
* - Add support StringSumHelper class in Arduino
11
- *
11
+ *
12
12
* v1.2.7
13
13
* - Fix string sub type checking issue
14
14
*
@@ -458,7 +458,12 @@ namespace mb_string
458
458
template <typename T>
459
459
auto toStringPtr (const T &val) -> typename MB_ENABLE_IF<MB_IS_SAME<T, StringSumHelper>::value, MB_StringPtr>::type
460
460
{
461
+ #if defined(ESP8266)
462
+ return MB_StringPtr (reinterpret_cast <uint32_t >(&val), getSubType (val), -1 );
463
+
464
+ #else
461
465
return MB_StringPtr (reinterpret_cast <uint32_t >(&val), getSubType (val), -1 , &val);
466
+ #endif
462
467
}
463
468
464
469
template <typename T>
@@ -519,16 +524,23 @@ class MB_String
519
524
*this = str;
520
525
}
521
526
527
+ #if !defined(ESP8266)
522
528
MB_String (StringSumHelper rval)
523
529
{
524
530
*this = rval;
525
531
}
532
+ #endif
526
533
527
534
MB_String (MB_StringPtr value)
528
535
{
529
536
*this = value;
530
537
}
531
538
539
+ MB_String (String value)
540
+ {
541
+ *this = value;
542
+ }
543
+
532
544
MB_String (bool value)
533
545
{
534
546
appendNum (value);
@@ -662,6 +674,7 @@ class MB_String
662
674
return *this ;
663
675
}
664
676
677
+ #if !defined(ESP8266)
665
678
MB_String &operator =(StringSumHelper rval)
666
679
{
667
680
String temp = rval;
@@ -675,6 +688,7 @@ class MB_String
675
688
*this += temp;
676
689
return *this ;
677
690
}
691
+ #endif
678
692
679
693
MB_String &operator +=(const __FlashStringHelper *str)
680
694
{
@@ -837,7 +851,11 @@ class MB_String
837
851
else if (src.type () == mb_string_sub_type_arduino_string)
838
852
*this += *addrTo<String *>(src.address ());
839
853
else if (src.type () == mb_string_sub_type_string_sum_helper)
854
+ #if !defined(ESP8266)
840
855
*this += *src.stringsumhelper ();
856
+ #else
857
+ *this += *addrTo<String *>(src.address ());
858
+ #endif
841
859
#if !defined(__AVR__)
842
860
else if (src.type () == mb_string_sub_type_std_string)
843
861
*this += *addrTo<std::string *>(src.address ());
0 commit comments