CloudConfigRK
Public Member Functions | Protected Attributes
CloudConfigStorageStatic Class Reference

Storage method that doesn't use the cloud at all and instead has the configuration as a static string in code. More...

#include <CloudConfigRK.h>

Inheritance diagram for CloudConfigStorageStatic:
CloudConfigStorage

Public Member Functions

 CloudConfigStorageStatic (const char *const jsonData)
 Constructor. More...
 
virtual void setup ()
 Called during setup() to parse the JSON data.
 
const char *const getJsonData () const
 Return the static JSON data.
 
- Public Member Functions inherited from CloudConfigStorage
 CloudConfigStorage ()
 Constructor. Base class constructor is empty.
 
bool hasJsonData () const
 Returns true if there is JSON data field is not empty.
 
virtual CloudConfigDataHeadergetDataHeader ()
 Gets a pointer to the data header. More...
 
virtual void parse ()
 Called after the JSON data is updated to parse the data using the JSON parser. More...
 
virtual void loop ()
 Called from loop(). Optional. Only needed if the storage method wants loop processing time.
 
JSONValue getJSONValue ()
 Gets the top level (outer) JSONValue object. More...
 
JSONValue getJSONValueForKey (const char *key)
 Gets the value for a given key in the top-level outer JSON object. More...
 
JSONValue getJSONValueAtIndex (size_t index)
 Gets the value for a given index in the a JSON array in the top-level outer JSON array. More...
 
virtual bool updateData (const char *json)
 This method is called to update the data in storage method and parse it again. More...
 

Protected Attributes

const char *const jsonData
 The value passed to the constructor.
 
- Protected Attributes inherited from CloudConfigStorage
JSONValue jsonObj
 The JSONValue object for the outermost JSON object (or array) More...
 

Additional Inherited Members

- Static Public Member Functions inherited from CloudConfigStorage
static JSONValue getJSONValueForKey (JSONValue parentObj, const char *key)
 Gets the value for a given key in the a JSON object. More...
 
static JSONValue getJSONValueAtIndex (JSONValue parentObj, size_t index)
 Gets the value for a given index in the a JSON array. More...
 
- Protected Member Functions inherited from CloudConfigStorage
virtual ~CloudConfigStorage ()
 Destructor. Base class destructor is empty. Also, you can't delete one of these.
 
 CloudConfigStorage (const CloudConfigStorage &)=delete
 This class is not copyable.
 
CloudConfigStorageoperator= (const CloudConfigStorage &)=delete
 This class is not copyable.
 

Detailed Description

Storage method that doesn't use the cloud at all and instead has the configuration as a static string in code.

This is mainly so you can use the same code base for cloud or local storage, swappable at compile time. It's a bit of overkill for normal use.

Constructor & Destructor Documentation

◆ CloudConfigStorageStatic()

CloudConfigStorageStatic::CloudConfigStorageStatic ( const char *const  jsonData)
inline

Constructor.

Parameters
jsonDataThe JSON data to use as the configuration data (string constant)

The documentation for this class was generated from the following file: