Permalink
Browse files

Fixes for compilation on linux and windows

  • Loading branch information...
1 parent 6637199 commit b32af4a7a9db4ed5b6cd49a549928c1d77e04276 @zeroniak committed Feb 18, 2013
@@ -258,7 +258,7 @@ DVBLinkRemoteStatusCode DVBLinkRemoteCommunication::GetData(const std::string& c
ClearErrorBuffer();
if ((status = SerializeRequestObject(command, request, xmlData)) != DVBLINK_REMOTE_STATUS_OK) {
- WriteError("Serialization of request object failed with error code %d (%s).\n", status, GetStatusCodeDescription(status));
+ WriteError("Serialization of request object failed with error code %d (%s).\n", status, GetStatusCodeDescription(status).c_str());
return status;
}
@@ -274,14 +274,14 @@ DVBLinkRemoteStatusCode DVBLinkRemoteCommunication::GetData(const std::string& c
if (!m_httpClient.SendRequest(*httpRequest)) {
status = DVBLINK_REMOTE_STATUS_CONNECTION_ERROR;
- WriteError("HTTP request failed with error code %d (%s).\n", status, GetStatusCodeDescription(status));
+ WriteError("HTTP request failed with error code %d (%s).\n", status, GetStatusCodeDescription(status).c_str());
}
else {
dvblinkremotehttp::HttpWebResponse* httpResponse = m_httpClient.GetResponse();
if (httpResponse->GetStatusCode() == 401) {
status = DVBLINK_REMOTE_STATUS_UNAUTHORISED;
- WriteError("HTTP response returned status code %d (%s).\n", httpResponse->GetStatusCode(), GetStatusCodeDescription(status));
+ WriteError("HTTP response returned status code %d (%s).\n", httpResponse->GetStatusCode(), GetStatusCodeDescription(status).c_str());
}
else if (httpResponse->GetStatusCode() != 200) {
status = DVBLINK_REMOTE_STATUS_ERROR;
@@ -291,7 +291,7 @@ DVBLinkRemoteStatusCode DVBLinkRemoteCommunication::GetData(const std::string& c
std::string responseData = httpResponse->GetResponseData();
if ((status = DeserializeResponseData(command, responseData, responseObject)) != DVBLINK_REMOTE_STATUS_OK) {
- WriteError("Deserialization of response data failed with error code %d (%s).\n", status, GetStatusCodeDescription(status));
+ WriteError("Deserialization of response data failed with error code %d (%s).\n", status, GetStatusCodeDescription(status).c_str());
}
}
@@ -31,6 +31,12 @@
namespace dvblinkremote
{
+
+ #ifndef _MSC_VER
+ #define vsprintf_s vsprintf
+ #define _snprintf_s(a,b,c,...) snprintf(a,b,__VA_ARGS__)
+ #endif
+
class DVBLinkRemoteCommunication : public IDVBLinkRemoteConnection
{
public:
@@ -27,11 +27,11 @@
using namespace dvblinkremote;
using namespace dvblinkremoteserialization;
-PlaybackContainer::PlaybackContainer(const std::string& objectId, const std::string& parentId, const std::string& name, const DVBLinkPlaybackContainerType containerType, const DVBLinkPlaybackContainerContentType containerContentType)
+PlaybackContainer::PlaybackContainer(const std::string& objectId, const std::string& parentId, const std::string& name, DVBLinkPlaybackContainerType& containerType, DVBLinkPlaybackContainerContentType& containerContentType)
: PlaybackObject(PlaybackObject::PLAYBACK_OBJECT_TYPE_CONTAINER, objectId, parentId),
m_name(name),
- m_containerType((DVBLinkPlaybackContainerType)containerType),
- m_containerContentType((DVBLinkPlaybackContainerContentType)containerContentType),
+ m_containerType((DVBLinkPlaybackContainerType&)containerType),
+ m_containerContentType((DVBLinkPlaybackContainerContentType&)containerContentType),
Description(""),
Logo(""),
TotalCount(0),
@@ -28,6 +28,12 @@
using namespace dvblinkremote;
using namespace dvblinkremoteserialization;
+RecordingSettings::RecordingSettings()
+{ }
+
+RecordingSettings::~RecordingSettings()
+{ }
+
GetRecordingSettingsRequest::GetRecordingSettingsRequest()
{ }
@@ -616,9 +616,11 @@ namespace dvblinkremote {
std::string m_clientId;
};
- class AddScheduleRequest : public Request, public Schedule
+ class AddScheduleRequest : public Request, public virtual Schedule
{
public:
+ //AddScheduleRequest(const DVBLinkScheduleType scheduleType, const std::string& channelId);
+ AddScheduleRequest();
virtual ~AddScheduleRequest() = 0;
};
@@ -627,7 +629,7 @@ namespace dvblinkremote {
* This is used as input parameter for the IDVBLinkRemoteConnection::AddSchedule method.
* @see IDVBLinkRemoteConnection::AddSchedule()
*/
- class AddManualScheduleRequest : public ManualSchedule
+ class AddManualScheduleRequest : public ManualSchedule, public AddScheduleRequest
{
public:
/**
@@ -653,7 +655,7 @@ namespace dvblinkremote {
* This is used as input parameter for the IDVBLinkRemoteConnection::AddSchedule method.
* @see IDVBLinkRemoteConnection::AddSchedule m()
*/
- class AddScheduleByEpgRequest : public EpgSchedule
+ class AddScheduleByEpgRequest : public EpgSchedule, public AddScheduleRequest
{
public:
/**
@@ -806,7 +806,7 @@ namespace dvblinkremote {
* @param containerContentType a constant DVBLinkPlaybackContainerContentType instance representing the content
* type of the playback items in this playback container.
*/
- PlaybackContainer(const std::string& objectId, const std::string& parentId, const std::string& name, const DVBLinkPlaybackContainerType containerType, const DVBLinkPlaybackContainerContentType containerContentType);
+ PlaybackContainer(const std::string& objectId, const std::string& parentId, const std::string& name, DVBLinkPlaybackContainerType& containerType, DVBLinkPlaybackContainerContentType& containerContentType);
/**
* Destructor for cleaning up allocated memory.
@@ -27,6 +27,11 @@
using namespace dvblinkremote;
using namespace dvblinkremoteserialization;
+Schedule::Schedule()
+{
+
+}
+
Schedule::Schedule(const DVBLinkScheduleType scheduleType, const std::string& channelId, const int recordingsToKeep)
: m_scheduleType(scheduleType),
m_channelId(channelId),
@@ -137,8 +142,19 @@ std::string& EpgSchedule::GetProgramID()
return m_programId;
}
+AddScheduleRequest::AddScheduleRequest()
+{
+
+}
+
+AddScheduleRequest::~AddScheduleRequest()
+{
+
+}
+
+
AddManualScheduleRequest::AddManualScheduleRequest(const std::string& channelId, const long startTime, const long duration, const long dayMask, const std::string& title)
- : ManualSchedule(channelId, startTime, duration, dayMask, title)
+ : ManualSchedule(channelId, startTime, duration, dayMask, title), AddScheduleRequest(), Schedule(Schedule::SCHEDULE_TYPE_MANUAL, channelId)
{
}
@@ -149,7 +165,7 @@ AddManualScheduleRequest::~AddManualScheduleRequest()
}
AddScheduleByEpgRequest::AddScheduleByEpgRequest(const std::string& channelId, const std::string& programId, const bool repeat, const bool newOnly, const bool recordSeriesAnytime)
- : EpgSchedule(channelId, programId, repeat, newOnly, recordSeriesAnytime)
+ : EpgSchedule(channelId, programId, repeat, newOnly, recordSeriesAnytime), AddScheduleRequest(), Schedule(Schedule::SCHEDULE_TYPE_BY_EPG, channelId)
{
}
@@ -240,7 +256,7 @@ bool GetSchedulesRequestSerializer::WriteObject(std::string& serializedData, Get
}
StoredManualSchedule::StoredManualSchedule(const std::string& id, const std::string& channelId, const long startTime, const long duration, const long dayMask, const std::string& title)
- : ManualSchedule(id, channelId, startTime, duration, dayMask, title)
+ : ManualSchedule(id, channelId, startTime, duration, dayMask, title), Schedule(Schedule::SCHEDULE_TYPE_MANUAL,id, channelId)
{
}
@@ -257,7 +273,7 @@ StoredManualScheduleList::~StoredManualScheduleList()
}
StoredEpgSchedule::StoredEpgSchedule(const std::string& id, const std::string& channelId, const std::string& programId, const bool repeat, const bool newOnly, const bool recordSeriesAnytime)
- : EpgSchedule(id, channelId, programId, repeat, newOnly, recordSeriesAnytime)
+ : EpgSchedule(id, channelId, programId, repeat, newOnly, recordSeriesAnytime), Schedule(Schedule::SCHEDULE_TYPE_BY_EPG,id, channelId)
{
}
@@ -103,7 +103,15 @@ namespace dvblinkremote {
*/
DVBLinkScheduleType& GetScheduleType();
+ protected:
+
+ /**
+ * Protected constructor used to solve diamond problem in adding schedules
+ */
+ Schedule();
+
private:
+
/**
* The identifier for the schedule.
*/
@@ -119,11 +127,11 @@ namespace dvblinkremote {
*/
DVBLinkScheduleType m_scheduleType;
};
-
+
/**
* Abstract base class for manual schedules.
*/
- class ManualSchedule : public Schedule
+ class ManualSchedule : public virtual Schedule
{
public:
/**
@@ -214,7 +222,7 @@ namespace dvblinkremote {
/**
* Abstract base class for electronic program guide (EPG) schedules.
*/
- class EpgSchedule : public Schedule
+ class EpgSchedule : public virtual Schedule
{
public:
/**

0 comments on commit b32af4a

Please sign in to comment.