From 7dfcde7c3ba4fc735350d580569a40fdc77e95a0 Mon Sep 17 00:00:00 2001 From: fgerlits Date: Fri, 7 Jan 2005 19:30:29 +0000 Subject: [PATCH] changed #includes to refer to the XmlRpcTools in Core removed XmlRpcTools and PlayLogEntry from Scheduler --- .../src/AddAudioClipToPlaylistMethod.cxx | 4 +- .../src/AddAudioClipToPlaylistMethodTest.cxx | 4 +- .../scheduler/src/CreatePlaylistMethod.cxx | 4 +- .../scheduler/src/DeletePlaylistMethod.cxx | 4 +- .../scheduler/src/DisplayAudioClipMethod.cxx | 4 +- .../scheduler/src/DisplayAudioClipsMethod.cxx | 4 +- .../scheduler/src/DisplayPlaylistMethod.cxx | 4 +- .../scheduler/src/DisplayPlaylistsMethod.cxx | 4 +- .../scheduler/src/DisplayScheduleMethod.cxx | 4 +- .../src/GeneratePlayReportMethod.cxx | 4 +- .../scheduler/src/GeneratePlayReportMethod.h | 6 +- .../scheduler/src/GetSchedulerTimeMethod.cxx | 4 +- .../scheduler/src/GetVersionMethod.cxx | 6 +- .../src/OpenPlaylistForEditingMethod.cxx | 4 +- .../src/OpenPlaylistForEditingMethodTest.cxx | 4 +- .../products/scheduler/src/PlayLogEntry.h | 170 ------ .../products/scheduler/src/PlayLogInterface.h | 6 +- .../src/RemoveAudioClipFromPlaylistMethod.cxx | 4 +- .../RemoveAudioClipFromPlaylistMethodTest.cxx | 4 +- .../src/RemoveFromScheduleMethod.cxx | 4 +- .../scheduler/src/RescheduleMethod.cxx | 4 +- .../src/RevertEditedPlaylistMethod.cxx | 4 +- .../src/RpcAddAudioClipToPlaylistTest.cxx | 4 +- .../scheduler/src/RpcUploadPlaylistTest.cxx | 4 +- .../scheduler/src/SavePlaylistMethod.cxx | 4 +- .../src/UpdateFadeInFadeOutMethod.cxx | 4 +- .../src/UpdateFadeInFadeOutMethodTest.cxx | 4 +- .../scheduler/src/UploadPlaylistMethod.cxx | 4 +- .../scheduler/src/ValidatePlaylistMethod.cxx | 4 +- .../src/ValidatePlaylistMethodTest.cxx | 4 +- .../products/scheduler/src/XmlRpcTools.cxx | 531 ------------------ .../products/scheduler/src/XmlRpcTools.h | 358 ------------ .../scheduler/src/XmlRpcToolsTest.cxx | 204 ------- .../products/scheduler/src/XmlRpcToolsTest.h | 133 ----- 34 files changed, 61 insertions(+), 1457 deletions(-) delete mode 100644 livesupport/products/scheduler/src/PlayLogEntry.h delete mode 100644 livesupport/products/scheduler/src/XmlRpcTools.cxx delete mode 100644 livesupport/products/scheduler/src/XmlRpcTools.h delete mode 100644 livesupport/products/scheduler/src/XmlRpcToolsTest.cxx delete mode 100644 livesupport/products/scheduler/src/XmlRpcToolsTest.h diff --git a/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethod.cxx b/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethod.cxx index 685549f6b..d91e05e2f 100644 --- a/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethod.cxx +++ b/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.11 $ + Version : $Revision: 1.12 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -46,7 +46,7 @@ #include "LiveSupport/Storage/StorageClientFactory.h" #include "ScheduleInterface.h" #include "ScheduleFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "AddAudioClipToPlaylistMethod.h" diff --git a/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethodTest.cxx b/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethodTest.cxx index 4aeb9be9e..2b619c43d 100644 --- a/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethodTest.cxx +++ b/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.10 $ + Version : $Revision: 1.11 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -47,7 +47,7 @@ #include "LiveSupport/Db/ConnectionManagerFactory.h" #include "LiveSupport/Storage/StorageClientFactory.h" #include "LiveSupport/Authentication/AuthenticationClientFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "OpenPlaylistForEditingMethod.h" #include "AddAudioClipToPlaylistMethod.h" diff --git a/livesupport/products/scheduler/src/CreatePlaylistMethod.cxx b/livesupport/products/scheduler/src/CreatePlaylistMethod.cxx index 92642e564..3edf36ab0 100644 --- a/livesupport/products/scheduler/src/CreatePlaylistMethod.cxx +++ b/livesupport/products/scheduler/src/CreatePlaylistMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.8 $ + Version : $Revision: 1.9 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/CreatePlaylistMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -46,7 +46,7 @@ #include "LiveSupport/Storage/StorageClientFactory.h" #include "ScheduleInterface.h" #include "ScheduleFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "CreatePlaylistMethod.h" diff --git a/livesupport/products/scheduler/src/DeletePlaylistMethod.cxx b/livesupport/products/scheduler/src/DeletePlaylistMethod.cxx index c8fcf6ad4..a7cd9e34e 100644 --- a/livesupport/products/scheduler/src/DeletePlaylistMethod.cxx +++ b/livesupport/products/scheduler/src/DeletePlaylistMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.8 $ + Version : $Revision: 1.9 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/DeletePlaylistMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -39,7 +39,7 @@ #include "LiveSupport/Storage/StorageClientFactory.h" #include "ScheduleInterface.h" #include "ScheduleFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "DeletePlaylistMethod.h" diff --git a/livesupport/products/scheduler/src/DisplayAudioClipMethod.cxx b/livesupport/products/scheduler/src/DisplayAudioClipMethod.cxx index 6664bfae8..6cc8377fc 100644 --- a/livesupport/products/scheduler/src/DisplayAudioClipMethod.cxx +++ b/livesupport/products/scheduler/src/DisplayAudioClipMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.6 $ + Version : $Revision: 1.7 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayAudioClipMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -46,7 +46,7 @@ #include "LiveSupport/Storage/StorageClientFactory.h" #include "ScheduleInterface.h" #include "ScheduleFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "DisplayAudioClipMethod.h" diff --git a/livesupport/products/scheduler/src/DisplayAudioClipsMethod.cxx b/livesupport/products/scheduler/src/DisplayAudioClipsMethod.cxx index 92dd16bfc..505d6cd24 100644 --- a/livesupport/products/scheduler/src/DisplayAudioClipsMethod.cxx +++ b/livesupport/products/scheduler/src/DisplayAudioClipsMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.5 $ + Version : $Revision: 1.6 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayAudioClipsMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -38,7 +38,7 @@ #include "LiveSupport/Storage/StorageClientInterface.h" #include "LiveSupport/Storage/StorageClientFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "DisplayAudioClipsMethod.h" diff --git a/livesupport/products/scheduler/src/DisplayPlaylistMethod.cxx b/livesupport/products/scheduler/src/DisplayPlaylistMethod.cxx index 23fafc886..7ea9536e0 100644 --- a/livesupport/products/scheduler/src/DisplayPlaylistMethod.cxx +++ b/livesupport/products/scheduler/src/DisplayPlaylistMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.7 $ + Version : $Revision: 1.8 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayPlaylistMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -46,7 +46,7 @@ #include "LiveSupport/Storage/StorageClientFactory.h" #include "ScheduleInterface.h" #include "ScheduleFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "DisplayPlaylistMethod.h" diff --git a/livesupport/products/scheduler/src/DisplayPlaylistsMethod.cxx b/livesupport/products/scheduler/src/DisplayPlaylistsMethod.cxx index 778b1b5f1..55df2a1ec 100644 --- a/livesupport/products/scheduler/src/DisplayPlaylistsMethod.cxx +++ b/livesupport/products/scheduler/src/DisplayPlaylistsMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.6 $ + Version : $Revision: 1.7 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayPlaylistsMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -38,7 +38,7 @@ #include "LiveSupport/Storage/StorageClientInterface.h" #include "LiveSupport/Storage/StorageClientFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "DisplayPlaylistsMethod.h" diff --git a/livesupport/products/scheduler/src/DisplayScheduleMethod.cxx b/livesupport/products/scheduler/src/DisplayScheduleMethod.cxx index b5ef71a53..4def56e53 100644 --- a/livesupport/products/scheduler/src/DisplayScheduleMethod.cxx +++ b/livesupport/products/scheduler/src/DisplayScheduleMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.5 $ + Version : $Revision: 1.6 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayScheduleMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -44,7 +44,7 @@ #include "ScheduleInterface.h" #include "ScheduleFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "DisplayScheduleMethod.h" diff --git a/livesupport/products/scheduler/src/GeneratePlayReportMethod.cxx b/livesupport/products/scheduler/src/GeneratePlayReportMethod.cxx index 2bacec29e..94b8898d3 100644 --- a/livesupport/products/scheduler/src/GeneratePlayReportMethod.cxx +++ b/livesupport/products/scheduler/src/GeneratePlayReportMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.4 $ + Version : $Revision: 1.5 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/GeneratePlayReportMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -44,7 +44,7 @@ #include "PlayLogInterface.h" #include "PlayLogFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "GeneratePlayReportMethod.h" diff --git a/livesupport/products/scheduler/src/GeneratePlayReportMethod.h b/livesupport/products/scheduler/src/GeneratePlayReportMethod.h index 0b2f1d7e4..f20f34eb8 100644 --- a/livesupport/products/scheduler/src/GeneratePlayReportMethod.h +++ b/livesupport/products/scheduler/src/GeneratePlayReportMethod.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.4 $ + Version : $Revision: 1.5 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/GeneratePlayReportMethod.h,v $ ------------------------------------------------------------------------------*/ @@ -49,7 +49,7 @@ #include #include "LiveSupport/Core/Ptr.h" -#include "PlayLogEntry.h" +#include "LiveSupport/Core/PlayLogEntry.h" namespace LiveSupport { @@ -104,7 +104,7 @@ using namespace LiveSupport::Core; * * * @author $Author: fgerlits $ - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ */ class GeneratePlayReportMethod : public XmlRpc::XmlRpcServerMethod { diff --git a/livesupport/products/scheduler/src/GetSchedulerTimeMethod.cxx b/livesupport/products/scheduler/src/GetSchedulerTimeMethod.cxx index 21a236489..4468e6d5d 100644 --- a/livesupport/products/scheduler/src/GetSchedulerTimeMethod.cxx +++ b/livesupport/products/scheduler/src/GetSchedulerTimeMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.4 $ + Version : $Revision: 1.5 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/GetSchedulerTimeMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -46,7 +46,7 @@ #include "LiveSupport/Storage/StorageClientInterface.h" #include "LiveSupport/Storage/StorageClientFactory.h" #include "LiveSupport/Core/TimeConversion.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "GetSchedulerTimeMethod.h" diff --git a/livesupport/products/scheduler/src/GetVersionMethod.cxx b/livesupport/products/scheduler/src/GetVersionMethod.cxx index 3688c0bf7..b7b17fe4e 100644 --- a/livesupport/products/scheduler/src/GetVersionMethod.cxx +++ b/livesupport/products/scheduler/src/GetVersionMethod.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.3 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.4 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/GetVersionMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -42,7 +42,7 @@ #include -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "GetVersionMethod.h" diff --git a/livesupport/products/scheduler/src/OpenPlaylistForEditingMethod.cxx b/livesupport/products/scheduler/src/OpenPlaylistForEditingMethod.cxx index 8d3c37425..1ed24cba6 100644 --- a/livesupport/products/scheduler/src/OpenPlaylistForEditingMethod.cxx +++ b/livesupport/products/scheduler/src/OpenPlaylistForEditingMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.12 $ + Version : $Revision: 1.13 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/OpenPlaylistForEditingMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -46,7 +46,7 @@ #include "LiveSupport/Storage/StorageClientFactory.h" #include "ScheduleInterface.h" #include "ScheduleFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "OpenPlaylistForEditingMethod.h" diff --git a/livesupport/products/scheduler/src/OpenPlaylistForEditingMethodTest.cxx b/livesupport/products/scheduler/src/OpenPlaylistForEditingMethodTest.cxx index 6097618bf..360b25c07 100644 --- a/livesupport/products/scheduler/src/OpenPlaylistForEditingMethodTest.cxx +++ b/livesupport/products/scheduler/src/OpenPlaylistForEditingMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.11 $ + Version : $Revision: 1.12 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/OpenPlaylistForEditingMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -47,7 +47,7 @@ #include "LiveSupport/Db/ConnectionManagerFactory.h" #include "LiveSupport/Storage/StorageClientFactory.h" #include "LiveSupport/Authentication/AuthenticationClientFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "OpenPlaylistForEditingMethod.h" #include "OpenPlaylistForEditingMethodTest.h" diff --git a/livesupport/products/scheduler/src/PlayLogEntry.h b/livesupport/products/scheduler/src/PlayLogEntry.h deleted file mode 100644 index 35cc2c8e7..000000000 --- a/livesupport/products/scheduler/src/PlayLogEntry.h +++ /dev/null @@ -1,170 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2004 Media Development Loan Fund - - This file is part of the LiveSupport project. - http://livesupport.campware.org/ - To report bugs, send an e-mail to bugs@campware.org - - LiveSupport is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - LiveSupport is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with LiveSupport; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Author : $Author: fgerlits $ - Version : $Revision: 1.3 $ - Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/PlayLogEntry.h,v $ - -------------------------------------------------------------------------------*/ -#ifndef LiveSupport_Scheduler_PlayLogEntry_h -#define LiveSupport_Scheduler_PlayLogEntry_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/UniqueId.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace boost::posix_time; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A class representing a play log entry. - * PlayLogEntries contain information about the audio clips played. - * - * @author $Author: fgerlits $ - * @version $Revision: 1.3 $ - */ -class PlayLogEntry -{ - private: - /** - * The unique id of the play log entry. - */ - Ptr::Ref id; - - /** - * The id of the audio clip referenced by this play log entry. - */ - Ptr::Ref audioClipId; - - /** - * The time this audio clip was played. - */ - Ptr::Ref timestamp; - - - public: - /** - * Default constructor. - */ - PlayLogEntry(void) throw () - { - } - - /** - * Create a play log entry by specifying all details. - * - * @param id the ID of the play log entry. - * @param audioClipId the ID of the audio clip logged - * @param timestamp the time this audio clip was played. - */ - PlayLogEntry(Ptr::Ref id, - Ptr::Ref audioClipId, - Ptr::Ref timestamp) throw() - { - this->id = id; - this->audioClipId = audioClipId; - this->timestamp = timestamp; - } - - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~PlayLogEntry(void) throw () - { - } - - /** - * Return the ID of the play log entry. - * - * @return the unique ID of the play log entry. - */ - Ptr::Ref - getId(void) const throw () - { - return id; - } - - /** - * Return the ID of the audio clip referenced by this entry. - * - * @return the unique ID of the audio clip. - */ - Ptr::Ref - getAudioClipId(void) const throw () - { - return audioClipId; - } - - /** - * Return the time this audio clip was played. - * - * @return the the time the audio clip was played. - */ - Ptr::Ref - getTimestamp(void) const throw () - { - return timestamp; - } - -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // LiveSupport_Scheduler_PlayLogEntry_h - diff --git a/livesupport/products/scheduler/src/PlayLogInterface.h b/livesupport/products/scheduler/src/PlayLogInterface.h index 7352191c4..5d441d041 100644 --- a/livesupport/products/scheduler/src/PlayLogInterface.h +++ b/livesupport/products/scheduler/src/PlayLogInterface.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.3 $ + Version : $Revision: 1.4 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PlayLogInterface.h,v $ ------------------------------------------------------------------------------*/ @@ -46,7 +46,7 @@ #include "LiveSupport/Core/Ptr.h" #include "LiveSupport/Core/Installable.h" #include "LiveSupport/Core/Playlist.h" -#include "PlayLogEntry.h" +#include "LiveSupport/Core/PlayLogEntry.h" namespace LiveSupport { @@ -70,7 +70,7 @@ using namespace LiveSupport::Core; * The generic interface for the component scheduling events. * * @author $Author: fgerlits $ - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ */ class PlayLogInterface : virtual public Installable { diff --git a/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethod.cxx b/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethod.cxx index e0f629a91..7423a5ebf 100644 --- a/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethod.cxx +++ b/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.8 $ + Version : $Revision: 1.9 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -46,7 +46,7 @@ #include "LiveSupport/Storage/StorageClientFactory.h" #include "ScheduleInterface.h" #include "ScheduleFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "RemoveAudioClipFromPlaylistMethod.h" diff --git a/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethodTest.cxx b/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethodTest.cxx index 95b84607c..acde9f7fa 100644 --- a/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethodTest.cxx +++ b/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.8 $ + Version : $Revision: 1.9 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -47,7 +47,7 @@ #include "LiveSupport/Db/ConnectionManagerFactory.h" #include "LiveSupport/Storage/StorageClientFactory.h" #include "LiveSupport/Authentication/AuthenticationClientFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "OpenPlaylistForEditingMethod.h" #include "AddAudioClipToPlaylistMethod.h" diff --git a/livesupport/products/scheduler/src/RemoveFromScheduleMethod.cxx b/livesupport/products/scheduler/src/RemoveFromScheduleMethod.cxx index 711e77c97..00165bf36 100644 --- a/livesupport/products/scheduler/src/RemoveFromScheduleMethod.cxx +++ b/livesupport/products/scheduler/src/RemoveFromScheduleMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.5 $ + Version : $Revision: 1.6 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RemoveFromScheduleMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -44,7 +44,7 @@ #include "ScheduleInterface.h" #include "ScheduleFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "RemoveFromScheduleMethod.h" diff --git a/livesupport/products/scheduler/src/RescheduleMethod.cxx b/livesupport/products/scheduler/src/RescheduleMethod.cxx index 95499308e..c46a90aba 100644 --- a/livesupport/products/scheduler/src/RescheduleMethod.cxx +++ b/livesupport/products/scheduler/src/RescheduleMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.5 $ + Version : $Revision: 1.6 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RescheduleMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -44,7 +44,7 @@ #include "ScheduleInterface.h" #include "ScheduleFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "RescheduleMethod.h" diff --git a/livesupport/products/scheduler/src/RevertEditedPlaylistMethod.cxx b/livesupport/products/scheduler/src/RevertEditedPlaylistMethod.cxx index a204d09f3..d1ca1ef5f 100644 --- a/livesupport/products/scheduler/src/RevertEditedPlaylistMethod.cxx +++ b/livesupport/products/scheduler/src/RevertEditedPlaylistMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.6 $ + Version : $Revision: 1.7 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RevertEditedPlaylistMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -44,7 +44,7 @@ #include "LiveSupport/Storage/StorageClientInterface.h" #include "LiveSupport/Storage/StorageClientFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "RevertEditedPlaylistMethod.h" diff --git a/livesupport/products/scheduler/src/RpcAddAudioClipToPlaylistTest.cxx b/livesupport/products/scheduler/src/RpcAddAudioClipToPlaylistTest.cxx index 34973a1ee..89f124a54 100644 --- a/livesupport/products/scheduler/src/RpcAddAudioClipToPlaylistTest.cxx +++ b/livesupport/products/scheduler/src/RpcAddAudioClipToPlaylistTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.5 $ + Version : $Revision: 1.6 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcAddAudioClipToPlaylistTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -48,7 +48,7 @@ #include "SchedulerDaemon.h" #include "LiveSupport/Storage/StorageClientFactory.h" #include "LiveSupport/Authentication/AuthenticationClientFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "OpenPlaylistForEditingMethod.h" #include "AddAudioClipToPlaylistMethod.h" diff --git a/livesupport/products/scheduler/src/RpcUploadPlaylistTest.cxx b/livesupport/products/scheduler/src/RpcUploadPlaylistTest.cxx index ae39f33e7..8c12427c6 100644 --- a/livesupport/products/scheduler/src/RpcUploadPlaylistTest.cxx +++ b/livesupport/products/scheduler/src/RpcUploadPlaylistTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.3 $ + Version : $Revision: 1.4 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcUploadPlaylistTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -44,7 +44,7 @@ #include #include -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "LiveSupport/Core/UniqueId.h" #include "SchedulerDaemon.h" #include "LiveSupport/Authentication/AuthenticationClientFactory.h" diff --git a/livesupport/products/scheduler/src/SavePlaylistMethod.cxx b/livesupport/products/scheduler/src/SavePlaylistMethod.cxx index c74e20391..08ce443a4 100644 --- a/livesupport/products/scheduler/src/SavePlaylistMethod.cxx +++ b/livesupport/products/scheduler/src/SavePlaylistMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.6 $ + Version : $Revision: 1.7 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/SavePlaylistMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -44,7 +44,7 @@ #include "LiveSupport/Storage/StorageClientInterface.h" #include "LiveSupport/Storage/StorageClientFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "SavePlaylistMethod.h" diff --git a/livesupport/products/scheduler/src/UpdateFadeInFadeOutMethod.cxx b/livesupport/products/scheduler/src/UpdateFadeInFadeOutMethod.cxx index 7b4e98f66..a04b4f177 100644 --- a/livesupport/products/scheduler/src/UpdateFadeInFadeOutMethod.cxx +++ b/livesupport/products/scheduler/src/UpdateFadeInFadeOutMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.5 $ + Version : $Revision: 1.6 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/UpdateFadeInFadeOutMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -48,7 +48,7 @@ #include "LiveSupport/Core/FadeInfo.h" #include "ScheduleInterface.h" #include "ScheduleFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "UpdateFadeInFadeOutMethod.h" diff --git a/livesupport/products/scheduler/src/UpdateFadeInFadeOutMethodTest.cxx b/livesupport/products/scheduler/src/UpdateFadeInFadeOutMethodTest.cxx index a9776ddf2..f323a1fec 100644 --- a/livesupport/products/scheduler/src/UpdateFadeInFadeOutMethodTest.cxx +++ b/livesupport/products/scheduler/src/UpdateFadeInFadeOutMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.5 $ + Version : $Revision: 1.6 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/UpdateFadeInFadeOutMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -47,7 +47,7 @@ #include "LiveSupport/Db/ConnectionManagerFactory.h" #include "LiveSupport/Storage/StorageClientFactory.h" #include "LiveSupport/Authentication/AuthenticationClientFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "OpenPlaylistForEditingMethod.h" #include "AddAudioClipToPlaylistMethod.h" diff --git a/livesupport/products/scheduler/src/UploadPlaylistMethod.cxx b/livesupport/products/scheduler/src/UploadPlaylistMethod.cxx index 7ce507362..1c37710d5 100644 --- a/livesupport/products/scheduler/src/UploadPlaylistMethod.cxx +++ b/livesupport/products/scheduler/src/UploadPlaylistMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.10 $ + Version : $Revision: 1.11 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/UploadPlaylistMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -46,7 +46,7 @@ #include "LiveSupport/Storage/StorageClientFactory.h" #include "ScheduleInterface.h" #include "ScheduleFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "UploadPlaylistMethod.h" diff --git a/livesupport/products/scheduler/src/ValidatePlaylistMethod.cxx b/livesupport/products/scheduler/src/ValidatePlaylistMethod.cxx index 04272e8c9..efd81aa67 100644 --- a/livesupport/products/scheduler/src/ValidatePlaylistMethod.cxx +++ b/livesupport/products/scheduler/src/ValidatePlaylistMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.7 $ + Version : $Revision: 1.8 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/ValidatePlaylistMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -46,7 +46,7 @@ #include "LiveSupport/Storage/StorageClientFactory.h" #include "ScheduleInterface.h" #include "ScheduleFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "ValidatePlaylistMethod.h" diff --git a/livesupport/products/scheduler/src/ValidatePlaylistMethodTest.cxx b/livesupport/products/scheduler/src/ValidatePlaylistMethodTest.cxx index baa91d28b..ddd64914a 100644 --- a/livesupport/products/scheduler/src/ValidatePlaylistMethodTest.cxx +++ b/livesupport/products/scheduler/src/ValidatePlaylistMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.6 $ + Version : $Revision: 1.7 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/ValidatePlaylistMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -47,7 +47,7 @@ #include "LiveSupport/Db/ConnectionManagerFactory.h" #include "LiveSupport/Storage/StorageClientFactory.h" #include "LiveSupport/Authentication/AuthenticationClientFactory.h" -#include "XmlRpcTools.h" +#include "LiveSupport/Core/XmlRpcTools.h" #include "OpenPlaylistForEditingMethod.h" #include "RemoveAudioClipFromPlaylistMethod.h" diff --git a/livesupport/products/scheduler/src/XmlRpcTools.cxx b/livesupport/products/scheduler/src/XmlRpcTools.cxx deleted file mode 100644 index b1065a987..000000000 --- a/livesupport/products/scheduler/src/XmlRpcTools.cxx +++ /dev/null @@ -1,531 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2004 Media Development Loan Fund - - This file is part of the LiveSupport project. - http://livesupport.campware.org/ - To report bugs, send an e-mail to bugs@campware.org - - LiveSupport is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - LiveSupport is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with LiveSupport; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Author : $Author: fgerlits $ - Version : $Revision: 1.12 $ - Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/XmlRpcTools.cxx,v $ - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#ifdef HAVE_TIME_H -#include -#else -#error need time.h -#endif - - -#include -#include "LiveSupport/Core/TimeConversion.h" - -#include "XmlRpcTools.h" - - -using namespace boost; -using namespace boost::posix_time; - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - -/*------------------------------------------------------------------------------ - * The name of the playlist ID member in the XML-RPC parameter structure - *----------------------------------------------------------------------------*/ -static const std::string playlistIdName = "playlistId"; - -/*------------------------------------------------------------------------------ - * The name of the audio clip ID member in the XML-RPC parameter structure - *----------------------------------------------------------------------------*/ -static const std::string audioClipIdName = "audioClipId"; - -/*------------------------------------------------------------------------------ - * The name of the relative offset member in the XML-RPC parameter structure - *----------------------------------------------------------------------------*/ -static const std::string relativeOffsetName = "relativeOffset"; - -/*------------------------------------------------------------------------------ - * The name of the from member in the XML-RPC parameter structure. - *----------------------------------------------------------------------------*/ -static const std::string fromTimeName = "from"; - -/*------------------------------------------------------------------------------ - * The name of the to member in the XML-RPC parameter structure. - *----------------------------------------------------------------------------*/ -static const std::string toTimeName = "to"; - -/*------------------------------------------------------------------------------ - * The name of the playlist id member in the XML-RPC parameter structure. - *----------------------------------------------------------------------------*/ -static const std::string scheduleEntryIdName = "scheduleEntryId"; - -/*------------------------------------------------------------------------------ - * The name of the playtime member in the XML-RPC parameter structure. - *----------------------------------------------------------------------------*/ -static const std::string playtimeName = "playtime"; - -/*------------------------------------------------------------------------------ - * The name of the fade in member in the XML-RPC parameter structure. - *----------------------------------------------------------------------------*/ -static const std::string fadeInName = "fadeIn"; - -/*------------------------------------------------------------------------------ - * The name of the fade out member in the XML-RPC parameter structure. - *----------------------------------------------------------------------------*/ -static const std::string fadeOutName = "fadeOut"; - -/*------------------------------------------------------------------------------ - * The name of the session ID member in the XML-RPC parameter structure - *----------------------------------------------------------------------------*/ -static const std::string sessionIdName = "sessionId"; - - -/* ================================================ local constants & macros */ - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Extract the schedule entry ID from an XML-RPC function call parameter - *----------------------------------------------------------------------------*/ -Ptr::Ref -XmlRpcTools :: extractScheduleEntryId( - XmlRpc::XmlRpcValue & xmlRpcValue) - throw (std::invalid_argument) -{ - if (!xmlRpcValue.hasMember(scheduleEntryIdName) - || xmlRpcValue[scheduleEntryIdName].getType() - != XmlRpc::XmlRpcValue::TypeString) { - throw std::invalid_argument("missing or bad schedule entry ID " - "argument"); - } - - Ptr::Ref id(new UniqueId(std::string( - xmlRpcValue[scheduleEntryIdName] ))); - return id; -} - - -/*------------------------------------------------------------------------------ - * Extract the playlist ID from an XML-RPC function call parameter - *----------------------------------------------------------------------------*/ -Ptr::Ref -XmlRpcTools :: extractPlaylistId(XmlRpc::XmlRpcValue & xmlRpcValue) - throw (std::invalid_argument) -{ - if (!xmlRpcValue.hasMember(playlistIdName) - || xmlRpcValue[playlistIdName].getType() - != XmlRpc::XmlRpcValue::TypeString) { - throw std::invalid_argument("missing or bad playlist ID argument"); - } - - Ptr::Ref id(new UniqueId(std::string( - xmlRpcValue[playlistIdName] ))); - return id; -} - - -/*------------------------------------------------------------------------------ - * Extract the audio clip ID from an XML-RPC function call parameter - *----------------------------------------------------------------------------*/ -Ptr::Ref -XmlRpcTools :: extractAudioClipId(XmlRpc::XmlRpcValue & xmlRpcValue) - throw (std::invalid_argument) -{ - if (!xmlRpcValue.hasMember(audioClipIdName) - || xmlRpcValue[audioClipIdName].getType() - != XmlRpc::XmlRpcValue::TypeString) { - throw std::invalid_argument("missing or bad audio clip ID argument"); - } - - Ptr::Ref id(new UniqueId(std::string( - xmlRpcValue[audioClipIdName] ))); - return id; -} - - -/*------------------------------------------------------------------------------ - * Extract the relative offset from an XML-RPC function call parameter - *----------------------------------------------------------------------------*/ -Ptr::Ref -XmlRpcTools :: extractRelativeOffset(XmlRpc::XmlRpcValue & xmlRpcValue) - throw (std::invalid_argument) -{ - if (!xmlRpcValue.hasMember(relativeOffsetName) - || xmlRpcValue[relativeOffsetName].getType() - != XmlRpc::XmlRpcValue::TypeInt) { - throw std::invalid_argument("missing relative offset argument"); - } - - Ptr::Ref relativeOffset(new time_duration(0,0, - int(xmlRpcValue[relativeOffsetName]), 0)); - return relativeOffset; -} - - -/*------------------------------------------------------------------------------ - * Convert a Playlist to an XmlRpcValue - *----------------------------------------------------------------------------*/ -void -XmlRpcTools :: playlistToXmlRpcValue( - Ptr::Ref playlist, - XmlRpc::XmlRpcValue & xmlRpcValue) - throw () -{ - xmlRpcValue["id"] = std::string(*playlist->getId()); - xmlRpcValue["playlength"] = int(playlist->getPlaylength()->total_seconds()); -} - - -/*------------------------------------------------------------------------------ - * Convert a vector of Playlists into an XML-RPC value. - * This function returns an XML-RPC array of XML-RPC structures. - *----------------------------------------------------------------------------*/ -void -XmlRpcTools :: playlistVectorToXmlRpcValue( - const Ptr::Ref> >::Ref playlistVector, - XmlRpc::XmlRpcValue & returnValue) - throw () -{ - returnValue.setSize(playlistVector->size()); - // a call to setSize() makes sure it's an XML-RPC - // array - - std::vector::Ref>::const_iterator it = - playlistVector->begin(); - int arraySize = 0; - while (it != playlistVector->end()) { - Ptr::Ref playlist = *it; - XmlRpc::XmlRpcValue returnStruct; - playlistToXmlRpcValue(playlist, returnStruct); - returnValue[arraySize++] = returnStruct; - ++it; - } -} - - -/*------------------------------------------------------------------------------ - * Convert an AudioClip to an XmlRpcValue - *----------------------------------------------------------------------------*/ -void -XmlRpcTools :: audioClipToXmlRpcValue( - Ptr::Ref audioClip, - XmlRpc::XmlRpcValue & xmlRpcValue) - throw () -{ - xmlRpcValue["id"] = std::string(*audioClip->getId()); - xmlRpcValue["playlength"] = int(audioClip->getPlaylength() - ->total_seconds()); -} - - -/*------------------------------------------------------------------------------ - * Convert a vector of AudioClips into an XML-RPC value. - * This function returns an XML-RPC array of XML-RPC structures. - *----------------------------------------------------------------------------*/ -void -XmlRpcTools :: audioClipVectorToXmlRpcValue( - const Ptr::Ref> >::Ref audioClipVector, - XmlRpc::XmlRpcValue & returnValue) - throw () -{ - returnValue.setSize(audioClipVector->size()); - // a call to setSize() makes sure it's an XML-RPC - // array - - std::vector::Ref>::const_iterator it = - audioClipVector->begin(); - int arraySize = 0; - while (it != audioClipVector->end()) { - Ptr::Ref audioClip = *it; - XmlRpc::XmlRpcValue returnStruct; - audioClipToXmlRpcValue(audioClip, returnStruct); - returnValue[arraySize++] = returnStruct; - ++it; - } -} - - -/*------------------------------------------------------------------------------ - * Convert an error code, error message pair to an XML-RPC fault response - *----------------------------------------------------------------------------*/ -void -XmlRpcTools :: markError(int errorCode, const std::string errorMessage, - XmlRpc::XmlRpcValue & xmlRpcValue) - throw (XmlRpc::XmlRpcException) -{ - throw XmlRpc::XmlRpcException(errorMessage, errorCode); -} - - -/*------------------------------------------------------------------------------ - * Convert the valid status of a playlist to an XmlRpcValue - *----------------------------------------------------------------------------*/ -void -XmlRpcTools :: validStatusToXmlRpcValue( - bool validStatus, - XmlRpc::XmlRpcValue & xmlRpcValue) - throw () -{ - xmlRpcValue["valid"] = XmlRpc::XmlRpcValue(validStatus); -} - - -/*------------------------------------------------------------------------------ - * Extract the from time from an XML-RPC function call parameter - *----------------------------------------------------------------------------*/ -Ptr::Ref -XmlRpcTools :: extractFromTime( - XmlRpc::XmlRpcValue & xmlRpcValue) - throw (std::invalid_argument) -{ - if (!xmlRpcValue.hasMember(fromTimeName) - || xmlRpcValue[fromTimeName].getType() - != XmlRpc::XmlRpcValue::TypeDateTime) { - throw std::invalid_argument("missing or bad 'from' time in " - "parameter structure"); - } - - struct tm time = (struct tm) xmlRpcValue[fromTimeName]; - return TimeConversion::tmToPtime(&time); -} - - -/*------------------------------------------------------------------------------ - * Extract the to time from an XML-RPC function call parameter - *----------------------------------------------------------------------------*/ -Ptr::Ref -XmlRpcTools :: extractToTime( - XmlRpc::XmlRpcValue & xmlRpcValue) - throw (std::invalid_argument) -{ - if (!xmlRpcValue.hasMember(toTimeName) - || xmlRpcValue[toTimeName].getType() - != XmlRpc::XmlRpcValue::TypeDateTime) { - throw std::invalid_argument("missing or bad 'to' time in " - "parameter structure"); - } - - struct tm time = (struct tm) xmlRpcValue[toTimeName]; - return TimeConversion::tmToPtime(&time); -} - - -/*------------------------------------------------------------------------------ - * Convert a boost::posix_time::ptime to an XmlRpcValue - *----------------------------------------------------------------------------*/ -void -XmlRpcTools :: ptimeToXmlRpcValue( - Ptr::Ref ptimeParam, - XmlRpc::XmlRpcValue& xmlRpcValue) - throw () -{ - struct tm time; - Ptr::Ref myPtime(new ptime(*ptimeParam)); // get rid of const - - TimeConversion::ptimeToTm(myPtime, time); - xmlRpcValue = XmlRpc::XmlRpcValue(&time); -} - - -/*------------------------------------------------------------------------------ - * Convert a vector of ScheduleEntries into an XML-RPC value. - * This function returns an XML-RPC array of XML-RPC structures. - *----------------------------------------------------------------------------*/ -void -XmlRpcTools :: scheduleEntriesToXmlRpcValue( - Ptr::Ref> >::Ref scheduleEntries, - XmlRpc::XmlRpcValue & returnValue) - throw () -{ - returnValue.setSize(scheduleEntries->size()); - // a call to setSize() makes sure it's an XML-RPC - // array - - std::vector::Ref>::iterator it - = scheduleEntries->begin(); - int arraySize = 0; - while (it != scheduleEntries->end()) { - Ptr::Ref entry = *it; - XmlRpc::XmlRpcValue returnStruct; - returnStruct["id"] = std::string(*entry->getId()); - returnStruct["playlistId"] = std::string(*entry->getPlaylistId()); - - XmlRpc::XmlRpcValue time; - ptimeToXmlRpcValue(entry->getStartTime(), time); - returnStruct["start"] = time; - - ptimeToXmlRpcValue(entry->getEndTime(), time); - returnStruct["end"] = time; - - returnValue[arraySize++] = returnStruct; - ++it; - } -} - - -/*------------------------------------------------------------------------------ - * Extract the playtime from an XML-RPC function call parameter - *----------------------------------------------------------------------------*/ -Ptr::Ref -XmlRpcTools :: extractPlayschedule( - XmlRpc::XmlRpcValue & xmlRpcValue) - throw (std::invalid_argument) -{ - if (!xmlRpcValue.hasMember(playtimeName) - || xmlRpcValue[playtimeName].getType() - != XmlRpc::XmlRpcValue::TypeDateTime) { - throw std::invalid_argument("missing or bad playtime in " - "parameter structure"); - } - - struct tm time = (struct tm) xmlRpcValue[playtimeName]; - return TimeConversion::tmToPtime(&time); -} - - -/*------------------------------------------------------------------------------ - * Extract the fade in time from an XML-RPC function call parameter - *----------------------------------------------------------------------------*/ -Ptr::Ref -XmlRpcTools :: extractFadeIn(XmlRpc::XmlRpcValue & xmlRpcValue) - throw (std::invalid_argument) -{ - if (!xmlRpcValue.hasMember(fadeInName) - || xmlRpcValue[fadeInName].getType() - != XmlRpc::XmlRpcValue::TypeInt) { - throw std::invalid_argument("missing or bad 'fade in' argument"); - } - - Ptr::Ref fadeIn(new time_duration(0,0, - int(xmlRpcValue[fadeInName]), 0)); - return fadeIn; -} - - -/*------------------------------------------------------------------------------ - * Extract the fade out time from an XML-RPC function call parameter - *----------------------------------------------------------------------------*/ -Ptr::Ref -XmlRpcTools :: extractFadeOut(XmlRpc::XmlRpcValue & xmlRpcValue) - throw (std::invalid_argument) -{ - if (!xmlRpcValue.hasMember(fadeOutName) - || xmlRpcValue[fadeOutName].getType() - != XmlRpc::XmlRpcValue::TypeInt) { - throw std::invalid_argument("missing or bad 'fade out' argument"); - } - - Ptr::Ref fadeOut(new time_duration(0,0, - int(xmlRpcValue[fadeOutName]), 0)); - return fadeOut; -} - - -/*------------------------------------------------------------------------------ - * Convert a schedule entry ID (a UniqueId) to an XmlRpcValue - *----------------------------------------------------------------------------*/ -void -XmlRpcTools :: scheduleEntryIdToXmlRpcValue( - Ptr::Ref scheduleEntryId, - XmlRpc::XmlRpcValue & returnValue) - throw () -{ - returnValue[scheduleEntryIdName] = std::string(*scheduleEntryId); -} - - -/*------------------------------------------------------------------------------ - * Convert a PlayLogEntry to an XmlRpcValue - *----------------------------------------------------------------------------*/ -void -XmlRpcTools :: playLogEntryToXmlRpcValue( - Ptr::Ref playLogEntry, - XmlRpc::XmlRpcValue & returnValue) - throw () -{ - returnValue["audioClipId"] = std::string(*playLogEntry->getAudioClipId()); - - XmlRpc::XmlRpcValue timestamp; - ptimeToXmlRpcValue(playLogEntry->getTimestamp(), timestamp); - returnValue["timestamp"] = timestamp; -} - - -/*------------------------------------------------------------------------------ - * Convert a vector of PlayLogEntries into an XML-RPC value. - * This function returns an XML-RPC array of XML-RPC structures. - *----------------------------------------------------------------------------*/ -void -XmlRpcTools :: playLogVectorToXmlRpcValue( - Ptr::Ref> >::Ref - playLogVector, - XmlRpc::XmlRpcValue & returnValue) - throw () -{ - returnValue.setSize(playLogVector->size()); - // a call to setSize() makes sure it's an XML-RPC - // array - - std::vector::Ref>::const_iterator it = - playLogVector->begin(); - int arraySize = 0; - while (it != playLogVector->end()) { - Ptr::Ref playLog = *it; - XmlRpc::XmlRpcValue returnStruct; - playLogEntryToXmlRpcValue(playLog, returnStruct); - returnValue[arraySize++] = returnStruct; - ++it; - } -} - - -/*------------------------------------------------------------------------------ - * Extract the session ID from an XML-RPC function call parameter - *----------------------------------------------------------------------------*/ -Ptr::Ref -XmlRpcTools :: extractSessionId( - XmlRpc::XmlRpcValue & xmlRpcValue) - throw (std::invalid_argument) -{ - if (!xmlRpcValue.hasMember(sessionIdName) - || xmlRpcValue[sessionIdName].getType() - != XmlRpc::XmlRpcValue::TypeString) { - throw std::invalid_argument("missing or bad session ID argument"); - } - - Ptr::Ref id(new SessionId(std::string( - xmlRpcValue[sessionIdName] ))); - return id; -} - diff --git a/livesupport/products/scheduler/src/XmlRpcTools.h b/livesupport/products/scheduler/src/XmlRpcTools.h deleted file mode 100644 index 500eaddd0..000000000 --- a/livesupport/products/scheduler/src/XmlRpcTools.h +++ /dev/null @@ -1,358 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2004 Media Development Loan Fund - - This file is part of the LiveSupport project. - http://livesupport.campware.org/ - To report bugs, send an e-mail to bugs@campware.org - - LiveSupport is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - LiveSupport is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with LiveSupport; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Author : $Author: maroy $ - Version : $Revision: 1.14 $ - Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/XmlRpcTools.h,v $ - -------------------------------------------------------------------------------*/ -#ifndef XmlRpcTools_h -#define XmlRpcTools_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/SessionId.h" -#include "LiveSupport/Core/Playlist.h" -#include "LiveSupport/Core/ScheduleEntry.h" -#include "PlayLogEntry.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A toolbox for converting between inner representations of classes - * and XmlRpcValues. Used by almost all XmlRpcServerMethod subclasses - * in the Scheduler. - * - * @author $Author: maroy $ - * @version $Revision: 1.14 $ - */ -class XmlRpcTools -{ - private: - - /** - * Convert a boost::posix_time::ptime to an XmlRpcValue - * - * @param ptime the ptime to convert - * @param xmlRpcValue the output parameter holding the value of - * the conversion. - */ - static void - ptimeToXmlRpcValue(Ptr::Ref ptime, - XmlRpc::XmlRpcValue & xmlRpcValue) - throw (); - - /** - * Convert a PlayLogEntry to an XmlRpcValue - * - * @param playLogEntry the PlayLogEntry to convert. - * @param xmlRpcValue the output parameter holding the result of - * the conversion. - */ - static void - playLogEntryToXmlRpcValue(Ptr::Ref playLogEntry, - XmlRpc::XmlRpcValue & returnValue) - throw (); - - public: - /** - * Extract the schedule entry id from the XML-RPC parameters. - * - * @param xmlRpcValue the XML-RPC parameter to extract from. - * @return a UniqueId that was found in the XML-RPC parameter. - * @exception std::invalid_argument if there was no UniqueId - * in xmlRpcValue - */ - static Ptr::Ref - extractScheduleEntryId(XmlRpc::XmlRpcValue & xmlRpcValue) - throw (std::invalid_argument); - - /** - * Extract the playlist id from the XML-RPC parameters. - * - * @param xmlRpcValue the XML-RPC parameter to extract from. - * @return a UniqueId that was found in the XML-RPC parameter. - * @exception std::invalid_argument if there was no playlistId - * member in xmlRpcValue - */ - static Ptr::Ref - extractPlaylistId(XmlRpc::XmlRpcValue & xmlRpcValue) - throw (std::invalid_argument); - - /** - * Extract the audio clip id from the XML-RPC parameters. - * - * @param xmlRpcValue the XML-RPC parameter to extract from. - * @return a UniqueId that was found in the XML-RPC parameter. - * @exception std::invalid_argument if there was no audioClipId - * member in xmlRpcValue - */ - static Ptr::Ref - extractAudioClipId(XmlRpc::XmlRpcValue & xmlRpcValue) - throw (std::invalid_argument); - - /** - * Extract the relative offset from the XML-RPC parameters. - * - * @param xmlRpcValue the XML-RPC parameter to extract from. - * @return a time_duration that was found in the XML-RPC parameter. - * @exception std::invalid_argument if there was no relativeOffset - * member in xmlRpcValue - */ - static Ptr::Ref - extractRelativeOffset(XmlRpc::XmlRpcValue & xmlRpcValue) - throw (std::invalid_argument); - - /** - * Convert a Playlist to an XmlRpcValue - * - * @param playlist the Playlist to convert. - * @param xmlRpcValue the output parameter holding the result of - * the conversion. - */ - static void - playlistToXmlRpcValue(Ptr::Ref playlist, - XmlRpc::XmlRpcValue & xmlRpcValue) - throw (); - - /** - * Convert a vector of Playlists to an XML-RPC return value. - * - * @param playlistVector a list of Playlists. - * @param returnValue the output parameter holding an XML-RPC - * representation of the list of Playlists. - */ - static void - playlistVectorToXmlRpcValue( - const Ptr::Ref> >::Ref playlistVector, - XmlRpc::XmlRpcValue & returnValue) - throw (); - - /** - * Convert an AudioClip to an XmlRpcValue - * - * @param audioClip the AudioClip to convert. - * @param xmlRpcValue the output parameter holding the result of - * the conversion. - */ - static void - audioClipToXmlRpcValue(Ptr::Ref audioClip, - XmlRpc::XmlRpcValue & xmlRpcValue) - throw (); - - /** - * Convert a vector of AudioClips to an XML-RPC return value. - * - * @param audioClipVector a list of AudioClips. - * @param returnValue the output parameter holding an XML-RPC - * representation of the list of AudioClips. - */ - static void - audioClipVectorToXmlRpcValue( - const Ptr::Ref> >::Ref audioClipVector, - XmlRpc::XmlRpcValue & returnValue) - throw (); - - /** - * Convert an error code, message pair to an XML-RPC fault response. - * This is done by throwing an XmlRpc::XmlRpcException. The client - * receives a fault response, and the return value is set to a - * { faultCode, faultString } structure holding the error code and - * message. - * - * @param errorCode the numerical code of the error. - * @param errorMessage a short English description of the error. - * @param xmlRpcValue remains here from an earlier version - * TODO: remove this later. - */ - static void - markError(int errorCode, const std::string errorMessage, - XmlRpc::XmlRpcValue & xmlRpcValue) - throw (XmlRpc::XmlRpcException); - - /** - * Convert the valid status of a playlist to an XmlRpcValue - * - * @param validStatus true if the playlist is valid, false otherwise. - * @param xmlRpcValue the output parameter holding the result of - * the conversion. - */ - static void - validStatusToXmlRpcValue(bool validStatus, - XmlRpc::XmlRpcValue & xmlRpcValue) - throw (); - - /** - * Extract the from time parameter from the XML-RPC parameters. - * - * @param xmlRpcValue the XML-RPC parameter to extract from. - * @return the time value for the from parameter - * @exception std::invalid_argument if there was no from parameter - * in xmlRpcValue - */ - static Ptr::Ref - extractFromTime(XmlRpc::XmlRpcValue & xmlRpcValue) - throw (std::invalid_argument); - - /** - * Extract the to parameter from the XML-RPC parameters. - * - * @param xmlRpcValue the XML-RPC parameter to extract from. - * @return the time value for the to parameter - * @exception std::invalid_argument if there was no to parameter - * in xmlRpcValue - */ - static Ptr::Ref - extractToTime(XmlRpc::XmlRpcValue & xmlRpcValue) - throw (std::invalid_argument); - - /** - * Extract the playtime from the XML-RPC parameters. - * - * @param xmlRpcValue the XML-RPC parameter to extract from. - * @return the playing time, as stored in the XML-RPC parameter - * @exception std::invalid_argument if there was no playtime - * in xmlRpcValue - */ - static Ptr::Ref - extractPlayschedule(XmlRpc::XmlRpcValue & xmlRpcValue) - throw (std::invalid_argument); - - /** - * Extract the fade in time from the XML-RPC parameters. - * - * @param xmlRpcValue the XML-RPC parameter to extract from. - * @return a time_duration that was found in the XML-RPC parameter. - * @exception std::invalid_argument if there was no fadeIn - * member in xmlRpcValue - */ - static Ptr::Ref - extractFadeIn(XmlRpc::XmlRpcValue & xmlRpcValue) - throw (std::invalid_argument); - - /** - * Extract the fade out time from the XML-RPC parameters. - * - * @param xmlRpcValue the XML-RPC parameter to extract from. - * @return a time_duration that was found in the XML-RPC parameter. - * @exception std::invalid_argument if there was no fadeOut - * member in xmlRpcValue - */ - static Ptr::Ref - extractFadeOut(XmlRpc::XmlRpcValue & xmlRpcValue) - throw (std::invalid_argument); - - /** - * Convert a vector of ScheduleEntries to an XML-RPC return value. - * - * @param scheduleEntries a list of ScheduleEntries. - * @param returnValue the output parameter holding an XML-RPC - * representation of the suppied schedule entires. - */ - static void - scheduleEntriesToXmlRpcValue( - Ptr::Ref> >::Ref scheduleEntries, - XmlRpc::XmlRpcValue & returnValue) - throw (); - - /** - * Convert a schedule entry ID (a UniqueId) to an XmlRpcValue - * - * @param scheduleEntryId the UniqueId to convert. - * @param returnValue the output parameter holding the result of - * the conversion. - */ - static void - scheduleEntryIdToXmlRpcValue( - Ptr::Ref scheduleEntryId, - XmlRpc::XmlRpcValue & returnValue) throw (); - - /** - * Convert a vector of PlayLogEntries to an XML-RPC return value. - * - * @param playLogVector a list of PlayLogEntries. - * @param returnValue the output parameter holding an XML-RPC - * representation of the list of PlayLogEntries. - */ - static void - playLogVectorToXmlRpcValue( - Ptr::Ref> >::Ref - playLogVector, - XmlRpc::XmlRpcValue & returnValue) - throw (); - - /** - * Extract the session ID from the XML-RPC parameters. - * - * @param xmlRpcValue the XML-RPC parameter to extract from. - * @return a SessionId that was found in the XML-RPC parameter. - * @exception std::invalid_argument if there was no sessionId - * member in xmlRpcValue - */ - static Ptr::Ref - extractSessionId(XmlRpc::XmlRpcValue & xmlRpcValue) - throw (std::invalid_argument); - -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // XmlRpcTools_h - diff --git a/livesupport/products/scheduler/src/XmlRpcToolsTest.cxx b/livesupport/products/scheduler/src/XmlRpcToolsTest.cxx deleted file mode 100644 index cd4d62837..000000000 --- a/livesupport/products/scheduler/src/XmlRpcToolsTest.cxx +++ /dev/null @@ -1,204 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2004 Media Development Loan Fund - - This file is part of the LiveSupport project. - http://livesupport.campware.org/ - To report bugs, send an e-mail to bugs@campware.org - - LiveSupport is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - LiveSupport is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with LiveSupport; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Author : $Author: fgerlits $ - Version : $Revision: 1.6 $ - Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/XmlRpcToolsTest.cxx,v $ - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - - -#include -#include -#include - -#include "LiveSupport/Db/ConnectionManagerFactory.h" -#include "LiveSupport/Storage/StorageClientFactory.h" -#include "XmlRpcTools.h" -#include "XmlRpcToolsTest.h" - - -using namespace LiveSupport::Db; -using namespace LiveSupport::Storage; -using namespace LiveSupport::Scheduler; - -using namespace std; -using namespace XmlRpc; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(XmlRpcToolsTest); - -/** - * The name of the configuration file for the playlist. - */ -const std::string configFileName = "etc/playlist.xml"; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Configure a Configurable with an XML file. - *----------------------------------------------------------------------------*/ -void -XmlRpcToolsTest :: configure( - Ptr::Ref configurable, - const std::string fileName) - throw (CPPUNIT_NS::Exception) -{ - try { - Ptr::Ref parser( - new xmlpp::DomParser(configFileName, true)); - const xmlpp::Document * document = parser->get_document(); - const xmlpp::Element * root = document->get_root_node(); - - configurable->configure(*root); - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - CPPUNIT_FAIL("error parsing configuration file"); - } -} - - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -XmlRpcToolsTest :: setUp(void) throw () -{ -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -XmlRpcToolsTest :: tearDown(void) throw () -{ -} - - -/*------------------------------------------------------------------------------ - * Just a very simple smoke test - *----------------------------------------------------------------------------*/ -void -XmlRpcToolsTest :: firstTest(void) - throw (CPPUNIT_NS::Exception) -{ - XmlRpcValue xmlRpcPlaylist; - XmlRpcValue xmlRpcAudioClip; - Ptr::Ref playlist = Ptr::Ref(new Playlist); - Ptr::Ref audioClip; - - // set up a playlist instance - configure(playlist, configFileName); - audioClip = playlist->begin()->second->getAudioClip(); - - // run the packing methods - XmlRpcTools :: playlistToXmlRpcValue(playlist, xmlRpcPlaylist); - XmlRpcTools :: audioClipToXmlRpcValue(audioClip, xmlRpcAudioClip); - - CPPUNIT_ASSERT(xmlRpcPlaylist.hasMember("id")); - CPPUNIT_ASSERT(xmlRpcPlaylist["id"].getType() == XmlRpcValue::TypeString); - CPPUNIT_ASSERT(std::string(xmlRpcPlaylist["id"]) == "0000000000000001"); - - CPPUNIT_ASSERT(xmlRpcPlaylist.hasMember("playlength")); - CPPUNIT_ASSERT(xmlRpcPlaylist["playlength"].getType() - == XmlRpcValue::TypeInt); - CPPUNIT_ASSERT(int(xmlRpcPlaylist["playlength"]) == 90 * 60); - - CPPUNIT_ASSERT(xmlRpcAudioClip.hasMember("id")); - CPPUNIT_ASSERT(xmlRpcAudioClip["id"].getType() == XmlRpcValue::TypeString); - CPPUNIT_ASSERT(std::string(xmlRpcAudioClip["id"]) == "0000000000010001"); - - CPPUNIT_ASSERT(xmlRpcAudioClip.hasMember("playlength")); - CPPUNIT_ASSERT(xmlRpcAudioClip["playlength"].getType() - == XmlRpcValue::TypeInt); - CPPUNIT_ASSERT(int(xmlRpcAudioClip["playlength"]) == 60 * 60); - - XmlRpcValue xmlRpcPlaylistId; - Ptr::Ref playlistId(new UniqueId(rand())); - Ptr::Ref audioClipId(new UniqueId(rand())); - Ptr::Ref relativeOffset(new time_duration(0,0,rand(),0)); - - xmlRpcPlaylistId["playlistId"] = std::string(*playlistId); - xmlRpcPlaylistId["audioClipId"] = std::string(*audioClipId); - xmlRpcPlaylistId["relativeOffset"] = relativeOffset->total_seconds(); - - // run the unpacking methods - Ptr::Ref newPlaylistId; - Ptr::Ref newAudioClipId; - Ptr::Ref newRelativeOffset; - try { - newPlaylistId = XmlRpcTools::extractPlaylistId(xmlRpcPlaylistId); - newAudioClipId = XmlRpcTools::extractAudioClipId(xmlRpcPlaylistId); - newRelativeOffset = XmlRpcTools::extractRelativeOffset(xmlRpcPlaylistId); - } - catch (std::invalid_argument &e) { - CPPUNIT_FAIL(e.what()); - } - - CPPUNIT_ASSERT(*playlistId == *newPlaylistId); - CPPUNIT_ASSERT(*audioClipId == *newAudioClipId); - CPPUNIT_ASSERT(*relativeOffset == *newRelativeOffset); -} - - -/*------------------------------------------------------------------------------ - * Testing markError() - *----------------------------------------------------------------------------*/ -void -XmlRpcToolsTest :: errorTest(void) - throw (CPPUNIT_NS::Exception) -{ - XmlRpcValue xmlRpcValue; - - try { - XmlRpcTools :: markError(42, "this is an error", xmlRpcValue); - CPPUNIT_FAIL("did not throw exception in markError()"); - } - catch (XmlRpc::XmlRpcException &e) { - CPPUNIT_ASSERT(e.getCode() == 42); - CPPUNIT_ASSERT(e.getMessage() == "this is an error"); - } -} - diff --git a/livesupport/products/scheduler/src/XmlRpcToolsTest.h b/livesupport/products/scheduler/src/XmlRpcToolsTest.h deleted file mode 100644 index cc564d177..000000000 --- a/livesupport/products/scheduler/src/XmlRpcToolsTest.h +++ /dev/null @@ -1,133 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2004 Media Development Loan Fund - - This file is part of the LiveSupport project. - http://livesupport.campware.org/ - To report bugs, send an e-mail to bugs@campware.org - - LiveSupport is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - LiveSupport is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with LiveSupport; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Author : $Author: fgerlits $ - Version : $Revision: 1.3 $ - Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/XmlRpcToolsTest.h,v $ - -------------------------------------------------------------------------------*/ -#ifndef XmlRpcToolsTest_h -#define XmlRpcToolsTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the XmlRpcTools class. - * - * @author $Author: fgerlits $ - * @version $Revision: 1.3 $ - * @see XmlRpcTools - */ -class XmlRpcToolsTest : public CPPUNIT_NS::TestFixture -{ - CPPUNIT_TEST_SUITE(XmlRpcToolsTest); - CPPUNIT_TEST(firstTest); - CPPUNIT_TEST(errorTest); - CPPUNIT_TEST_SUITE_END(); - - private: - - /** - * Configure a configurable with an XML file. - * - * @param configurable configure this - * @param fileName the name of the XML file to configure with. - * @exception CPPUNIT_NS::Exception on XML parsing errors. - */ - void - configure(Ptr::Ref configurable, - std::string fileName) - throw (CPPUNIT_NS::Exception); - - protected: - - /** - * A simple test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - firstTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Testing the method for error message packaging. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - errorTest(void) throw (CPPUNIT_NS::Exception); - - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // XmlRpcToolsTest_h -