Repository: xbmc/xbmc
File: xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/pvr/Timers.h (C/C++)

Code before:
  void SetSeriesLink(const std::string& seriesLink)
  {
    strncpy(m_cStructure->strSeriesLink, seriesLink.c_str(),
            sizeof(m_cStructure->strSeriesLink) - 1);
  }

  /// @brief To get with @ref SetSeriesLink changed values.
  std::string GetSeriesLink() const { return m_cStructure->strSeriesLink; }

  /// @brief **optional**\n
  /// Parental age rating
  void SetParentalRating(int parentalRating) { m_cStructure->iParentalRating = parentalRating; }

  /// @brief To get with @ref SetParentalRating changed values.
  int GetParentalRating() const { return m_cStructure->iParentalRating; }

  /// @brief **optional**\n
  /// Parental rating code.
  void SetParentalRatingCode(const std::string& parentalRatingCode)
  {
    strncpy(m_cStructure->strParentalRatingCode, parentalRatingCode.c_str(),
            sizeof(m_cStructure->strParentalRatingCode) - 1);
  }

  /// @brief To get with @ref SetParentalRatingCode.
  std::string GetParentalRatingCode() const { return m_cStructure->strParentalRatingCode; }

  /// @brief **optional**\n
  /// Parental rating icon.
  void SetParentalRatingIcon(const std::string& parentalRatingIcon)
  {
    strncpy(m_cStructure->strParentalRatingIcon, parentalRatingIcon.c_str(),
            sizeof(m_cStructure->strParentalRatingIcon) - 1);
  }

  /// @brief To get with @ref SetParentalRatingIcon.
  std::string GetParentalRatingIcon() const { return m_cStructure->strParentalRatingIcon; }
  ///@}

private:
  PVRTimer(const PVR_TIMER* data) : CStructHdl(data) {}
  PVRTimer(PVR_TIMER* data) : CStructHdl(data) {}
};

///@}
//------------------------------------------------------------------------------

//==============================================================================
/// @defgroup cpp_kodi_addon_pvr_Defs_Timer_PVRTimersResultSet class PVRTimersResultSet
/// @ingroup cpp_kodi_addon_pvr_Defs_Timer_PVRTimer
/// @brief **PVR add-on timer transfer class**\n

Review comment (suggestion):
Commit message only talks about introduction of parental rating icon. Actually this commit contains much more changes, like introduction of more functionality for timers. The latter should be a separate commit of this PR.

Code after:
  }
  ///@}

  static void AllocResources(const PVR_TIMER* source, PVR_TIMER* target)
  {
    target->strTitle = AllocAndCopyString(source->strTitle);
    target->strEpgSearchString = AllocAndCopyString(source->strEpgSearchString);
    target->strDirectory = AllocAndCopyString(source->strDirectory);
    target->strSummary = AllocAndCopyString(source->strSummary);
    target->strSeriesLink = AllocAndCopyString(source->strSeriesLink);
  }

  static void FreeResources(PVR_TIMER* target)
  {
    FreeString(target->strTitle);
    FreeString(target->strEpgSearchString);
    FreeString(target->strDirectory);
    FreeString(target->strSummary);
    FreeString(target->strSeriesLink);
  }

private:
  PVRTimer(const PVR_TIMER* timer) : DynamicCStructHdl(timer) {}
  PVRTimer(PVR_TIMER* timer) : DynamicCStructHdl(timer) {}
};

///@}
//------------------------------------------------------------------------------

//==============================================================================
/// @defgroup cpp_kodi_addon_pvr_Defs_Timer_PVRTimersResultSet class PVRTimersResultSet
/// @ingroup cpp_kodi_addon_pvr_Defs_Timer_PVRTimer
/// @brief **PVR add-on timer transfer class**\n
/// To transfer the content of @ref kodi::addon::CInstancePVRClient::GetTimers().
///
/// @note This becomes only be used on addon call above, not usable outside on
/// addon itself.
///@{
class PVRTimersResultSet
{
public:
  /*! \cond PRIVATE */
  PVRTimersResultSet() = delete;
  PVRTimersResultSet(const AddonInstance_PVR* instance, PVR_HANDLE handle)
    : m_instance(instance), m_handle(handle)
  {
  }
  /*! \endcond */

  /// @addtogroup cpp_kodi_addon_pvr_Defs_Timer_PVRTimersResultSet
  ///@{