2017-05-17 Fred Gleason <fredg@paravelsystems.com>

* Added an 'RDSystem::xml()' method in 'lib/rdsystem.cpp' and
	'lib/rdsystem.h'.
	* Added a 'ListSystemSettings' web API call.
This commit is contained in:
Fred Gleason
2017-05-17 12:33:49 -04:00
parent c4af1a9f1b
commit bfcdaa6dfc
11 changed files with 145 additions and 0 deletions

View File

@@ -42,6 +42,7 @@ dist_rdxport_cgi_SOURCES = audioinfo.cpp\
rehash.cpp\
schedcodes.cpp\
services.cpp\
systemsettings.cpp\
trimaudio.cpp
rdxport_cgi_LDADD = @LIB_RDLIBS@ -lsndfile @LIBVORBIS@

View File

@@ -266,6 +266,10 @@ Xport::Xport(QObject *parent)
ListServices();
break;
case RDXPORT_COMMAND_LISTSYSTEMSETTINGS:
ListSystemSettings();
break;
case RDXPORT_COMMAND_REHASH:
Rehash();
break;

View File

@@ -76,6 +76,7 @@ class Xport : public QObject
void UnassignSchedCode();
void ListCartSchedCodes();
void ListServices();
void ListSystemSettings();
void Exit(int code);
void XmlExit(const QString &msg,int code,
const QString &srcfile="",int line=-1,

View File

@@ -0,0 +1,45 @@
// listsystemsettings.cpp
//
// Rivendell web service portal -- ListSystemSettings service
//
// (C) Copyright 2011,2016 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// This program 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 this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
#include <stdio.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <rdformpost.h>
#include <rdweb.h>
#include <rdsystem.h>
#include <rdconf.h>
#include <rdxport.h>
void Xport::ListSystemSettings()
{
RDSystem *sys=new RDSystem();
//
// Send Data
//
printf("Content-type: application/xml\n\n");
printf("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
printf("%s\n",(const char *)sys->xml());
Exit(0);
}