#ifndef ARENA_PINMUX_JSON_OBJECT_H
#define ARENA_PINMUX_JSON_OBJECT_H
//----------------------------------------------------------------------------
///
/// \file   jsonObject.h
///
/// \brief  See implementation for further details
///
/// \date   20230316
/// \author Maximilian Seesslen <mes@seesslen.net>
///
//----------------------------------------------------------------------------


//---Documentation------------------------------------------------------------


//---Includes -----------------------------------------------------------------


//---General--------------------------

#include <QObject>
#include <QJsonObject>
#include <QVariant>


//---Declaration --------------------------------------------------------------


class CJsonObject
{
private:
   QJsonObject m_object;

public:
   CJsonObject( )
   {
   }
   const QString getAttribute(const QString attr) const;
   const QStringList getAttributeList(const QString attr) const;
   bool attributeSet( const QString attr ) const;
   void setJsonObject( const QJsonObject &object )
   {
      m_object = object;
   }
   void addJsonObject( const QJsonObject &object )
   {
      for (auto it = object.begin(); it != object.end(); it++)
      {
         m_object.insert(it.key(), it.value());
      }
   }
   const QJsonObject &getJsonObject( ) const
   {
      return( m_object );
   }
   QStringList getInitFunctions() const
   {
      QStringList list;
      QString initFunction=getAttribute( "initFunction" );
      if( ! initFunction.isEmpty() )
      {
         list << initFunction;
      }
      QStringList initFunctions=getAttributeList( "initFunctions" );
      list << initFunctions;
      
      return(list);
   }
   
};


//---fin----------------------------------------------------------------------
#endif // ? ! ARENA_PINMUX_JSON_OBJECT_H
