Your ROOT_URL in app.ini is https://source.parasitstudio.de:63000/ but you are visiting https://source.parasitstudio.de/wirtz/MicroDexed/src/commit/477445e0d01b3792e5c8d2bbe987f6cee04da738/third-party/ArduinoJson/extras/tests/Helpers/api/String.h You should set ROOT_URL correctly, otherwise the web may not work correctly.

58 lines
1.1 KiB

// ArduinoJson - https://arduinojson.org
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once
#include <string>
// Reproduces Arduino's String class
class String {
public:
String() : _maxCapacity(1024) {}
explicit String(const char* s) : _str(s), _maxCapacity(1024) {}
void limitCapacityTo(size_t maxCapacity) {
_maxCapacity = maxCapacity;
}
unsigned char concat(const char* s) {
return concat(s, strlen(s));
}
size_t length() const {
return _str.size();
}
const char* c_str() const {
return _str.c_str();
}
bool operator==(const char* s) const {
return _str == s;
}
friend std::ostream& operator<<(std::ostream& lhs, const ::String& rhs) {
lhs << rhs._str;
return lhs;
}
protected:
// This function is protected in most Arduino cores
unsigned char concat(const char* s, size_t n) {
if (_str.size() + n > _maxCapacity)
return 0;
_str.append(s, n);
return 1;
}
private:
std::string _str;
size_t _maxCapacity;
};
class StringSumHelper;
inline bool operator==(const std::string& lhs, const ::String& rhs) {
return lhs == rhs.c_str();
}