MCPcopy Create free account
hub / github.com/SmingHub/Sming / saveToFile

Function saveToFile

Sming/Libraries/ArduinoJson6/include/ArduinoJson.h:257–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255 */
256template <typename TSource>
257bool saveToFile(const TSource& source, const String& filename, SerializationFormat format = JSON_FORMAT_DEFAULT)
258{
259 FileStream stream(filename, File::WriteOnly | File::CreateNewAlways);
260 if(!stream.isValid()) {
261 return false;
262 }
263
264 if(serialize(source, stream, format) == 0) {
265 return false;
266 }
267
268 return stream.getLastError() == 0;
269}
270
271template <typename TInput>
272bool deserializeInternal(JsonDocument& doc, TInput& input, SerializationFormat format = JSON_FORMAT_DEFAULT)

Callers 4

saveConfigFunction · 0.85
saveMethod · 0.85
saveConfigFunction · 0.85
executeMethod · 0.85

Calls 3

serializeFunction · 0.85
getLastErrorMethod · 0.80
isValidMethod · 0.45

Tested by

no test coverage detected