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


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


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


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

#include <QString>
#include <QMap>
#include <QList>
#include <QJsonObject>

//---Own------------------------------

#include "periphery.h"
#include "periphery_list.h"
#include "path.h"


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


class CBoard
      :public CPeripheryList
      ,public CPath
{
private:
   QString name;
   QString id;
   QString description;
   QString alias;
   QVariantMap m_properties;
   QVariantList m_overloadingAttributes;
   bool m_final=true;
   QStringList m_path;
   QStringList m_loadedFiles;
   QString m_mainFile;
   QStringList m_alternateFunctionGroups;

   QStringList m_options;

public:
   int parseJson(const QJsonObject &jsonObject, QStringList &includes);
   void loadProperties(const QJsonObject &jsonObject);
   void loadOverloadingAttributes(const QJsonObject &jsonObject);
   bool loadFile(const QString &fileName);
   bool loadByteArray(const QByteArray &array, const QString &fileName);
   const QString &getName() const { return(name); }
   const QString &getId() const { return(id); }
   void shuffle();
   const QVariantMap& getProperties() const
   {
      return(m_properties);
   }
   void addProperty(const QString &key, const QString &value)
   {
      m_properties[key]=value;
   }
   bool isOverloadingAttribute(const QString &attribute) const;
   QString getOverloadingAttributes() const;
   void setMainFile( const QString &file)
   {
      m_mainFile=file;
   };
   const QString &getMainFile( ) const
   {
      return(m_mainFile);
   };
   const QStringList &getLoadedFiles( ) const
   {
      return(m_loadedFiles);
   };
   const QStringList &getAlternateFunctionGroups() const
   {
      return( m_alternateFunctionGroups );
   }
   void setOptions( const QStringList optionList )
   {
      m_options=optionList;
   }
   const QStringList& getOptions( ) const
   {
      return( m_options );
   }
   void cleanupMissingOptions( );
};


//---fin----------------------------------------------------------------------
#endif // ? ! _PINMUX_BOARD_H_
