MCPcopy Create free account
hub / github.com/BlueAndi/Pixelix / loadConfiguration

Method loadConfiguration

lib/Plugin/src/PluginWithConfig.hpp:297–316  ·  view source on GitHub ↗

* Load configuration from JSON file. * * @return If successful loaded, it will return true otherwise false. */

Source from the content-addressed store, hash-verified

295 * @return If successful loaded, it will return true otherwise false.
296 */
297 bool loadConfiguration()
298 {
299 bool status = true;
300 JsonFile jsonFile(m_fs);
301 const size_t JSON_DOC_SIZE = 1024U;
302 DynamicJsonDocument jsonDoc(JSON_DOC_SIZE);
303 JsonObjectConst jsonRootObject = jsonDoc.to<JsonObject>();
304 String configurationFilename = getFullPathToConfiguration();
305
306 if (false == jsonFile.load(configurationFilename, jsonDoc))
307 {
308 status = false;
309 }
310 else
311 {
312 status = setConfiguration(jsonRootObject);
313 }
314
315 return status;
316 }
317
318private:
319

Callers

nothing calls this directly

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected