| 44 | } |
| 45 | |
| 46 | friend int stringCompare(FlashString a, RamString b) { |
| 47 | ARDUINOJSON_ASSERT(a.typeSortKey < b.typeSortKey); |
| 48 | ARDUINOJSON_ASSERT(!a.isNull()); |
| 49 | ARDUINOJSON_ASSERT(!b.isNull()); |
| 50 | size_t minsize = a.size() < b.size() ? a.size() : b.size(); |
| 51 | int res = ::memcmp_P(b.data(), a.str_, minsize); |
| 52 | if (res) |
| 53 | return -res; |
| 54 | if (a.size() < b.size()) |
| 55 | return -1; |
| 56 | if (a.size() > b.size()) |
| 57 | return 1; |
| 58 | return 0; |
| 59 | } |
| 60 | |
| 61 | friend void stringGetChars(FlashString s, char* p, size_t n) { |
| 62 | ARDUINOJSON_ASSERT(s.size() <= n); |