A library for string creation without std:: overhead. It allows you to create strings using the c++ stream operator (<<).
#include <EasyStringStream.h>
char test[1024];
EasyStringStream ss(test, 1024);
float temperature = 36.6f;
int pressure = 1020;
const char* name = "Thermometer";
void setup() {
ss << "temperature=" << temperature << "&pressure=" << pressure << "&name=" << name;
while (!Serial);
Serial.begin(9600);
Serial.println(ss.get()); //prints "temperature=36.60&pressure=1020&name=Thermometer"
Serial.println(test); //works the same as above statement
}
void loop() {
}
Constructor. You need to provide pointer to the buffer, and the size of the buffer.
Return true
whenever at least one byte can be written to the buffer, otherwise false
.
Sets base for numeric values. The default is 10 (decimal).
Sets amounts of digits after float decimal place. The default value is 2.
Fills the buffer with zeros.
Returns pointer to the string.
Returns current position in the stream.
Return length of the buffer
Adds the ...
thing to the stream and returns the amount of bytes the cursor had been moved. You can use this instead of the <<
operator.