// Extract db id of item
CVariant object = data.isNull() || data.isObject() ? data : CVariant::VariantTypeObject;
- CStdString type;
+ std::string type;
int id = 0;
if(item->HasPVRChannelInfoTag())
CVideoDatabase videodatabase;
if (videodatabase.Open())
{
- CStdString path = item->GetPath();
- CStdString videoInfoTagPath(item->GetVideoInfoTag()->m_strFileNameAndPath);
+ std::string path = item->GetPath();
+ std::string videoInfoTagPath(item->GetVideoInfoTag()->m_strFileNameAndPath);
if (StringUtils::StartsWith(videoInfoTagPath, "removable://"))
path = videoInfoTagPath;
if (videodatabase.LoadVideoInfo(path, *item->GetVideoInfoTag()))
// TODO: Can be removed once this is properly handled when starting playback of a file
item->SetProperty(LOOKUP_PROPERTY, false);
- CStdString title = item->GetVideoInfoTag()->m_strTitle;
+ std::string title = item->GetVideoInfoTag()->m_strTitle;
if (title.empty())
title = item->GetLabel();
object["item"]["title"] = title;
// TODO: Can be removed once this is properly handled when starting playback of a file
item->SetProperty(LOOKUP_PROPERTY, false);
- CStdString title = item->GetMusicInfoTag()->GetTitle();
+ std::string title = item->GetMusicInfoTag()->GetTitle();
if (title.empty())
title = item->GetLabel();
object["item"]["title"] = title;
using namespace ADDON;
using namespace XFILE;
-JSONRPC_STATUS CAddonsOperations::GetAddons(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CAddonsOperations::GetAddons(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
vector<TYPE> addonTypes;
TYPE addonType = TranslateType(parameterObject["type"].asString());
return OK;
}
-JSONRPC_STATUS CAddonsOperations::GetAddonDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CAddonsOperations::GetAddonDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
string id = parameterObject["addonid"].asString();
AddonPtr addon;
return OK;
}
-JSONRPC_STATUS CAddonsOperations::SetAddonEnabled(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CAddonsOperations::SetAddonEnabled(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
string id = parameterObject["addonid"].asString();
bool disabled = false;
return ACK;
}
-JSONRPC_STATUS CAddonsOperations::ExecuteAddon(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CAddonsOperations::ExecuteAddon(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
string id = parameterObject["addonid"].asString();
AddonPtr addon;
argv = StringUtils::Paramify(params.asString());
}
- CStdString cmd;
+ std::string cmd;
if (params.size() == 0)
cmd = StringUtils::Format("RunAddon(%s)", id.c_str());
else
}
else if (field == "fanart" || field == "thumbnail")
{
- CStdString url = addonInfo[field].asString();
+ std::string url = addonInfo[field].asString();
// We need to check the existence of fanart and thumbnails as the addon simply
// holds where the art will be, not whether it exists.
bool needsRecaching;
- CStdString image = CTextureCache::Get().CheckCachedImage(url, false, needsRecaching);
+ std::string image = CTextureCache::Get().CheckCachedImage(url, false, needsRecaching);
if (!image.empty() || CFile::Exists(url))
object[field] = CTextureUtils::GetWrappedImageURL(url);
else
*
*/
-#include "utils/StdString.h"
#include "JSONRPC.h"
#include "addons/IAddon.h"
class CAddonsOperations : public CJSONUtils
{
public:
- static JSONRPC_STATUS GetAddons(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetAddonDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetAddons(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetAddonDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS SetAddonEnabled(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS ExecuteAddon(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS SetAddonEnabled(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS ExecuteAddon(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
private:
static void FillDetails(ADDON::AddonPtr addon, const CVariant& fields, CVariant &result, CAddonDatabase &addondb, bool append = false);
using namespace JSONRPC;
-JSONRPC_STATUS CApplicationOperations::GetProperties(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CApplicationOperations::GetProperties(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVariant properties = CVariant(CVariant::VariantTypeObject);
for (unsigned int index = 0; index < parameterObject["properties"].size(); index++)
{
- CStdString propertyName = parameterObject["properties"][index].asString();
+ std::string propertyName = parameterObject["properties"][index].asString();
CVariant property;
JSONRPC_STATUS ret;
if ((ret = GetPropertyValue(propertyName, property)) != OK)
return OK;
}
-JSONRPC_STATUS CApplicationOperations::SetVolume(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CApplicationOperations::SetVolume(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
bool up = false;
if (parameterObject["volume"].isInteger())
return GetPropertyValue("volume", result);
}
-JSONRPC_STATUS CApplicationOperations::SetMute(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CApplicationOperations::SetMute(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
if ((parameterObject["mute"].isString() && parameterObject["mute"].asString().compare("toggle") == 0) ||
(parameterObject["mute"].isBoolean() && parameterObject["mute"].asBoolean() != g_application.IsMuted()))
return GetPropertyValue("muted", result);
}
-JSONRPC_STATUS CApplicationOperations::Quit(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CApplicationOperations::Quit(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CApplicationMessenger::Get().Quit();
return ACK;
}
-JSONRPC_STATUS CApplicationOperations::GetPropertyValue(const CStdString &property, CVariant &result)
+JSONRPC_STATUS CApplicationOperations::GetPropertyValue(const std::string &property, CVariant &result)
{
- if (property.Equals("volume"))
+ if (property == "volume")
result = (int)g_application.GetVolume();
- else if (property.Equals("muted"))
+ else if (property == "muted")
result = g_application.IsMuted();
- else if (property.Equals("name"))
+ else if (property == "name")
result = "XBMC";
- else if (property.Equals("version"))
+ else if (property == "version")
{
result = CVariant(CVariant::VariantTypeObject);
result["major"] = CCompileInfo::GetMajor();
*
*/
-#include "utils/StdString.h"
#include "JSONRPC.h"
#include "FileItemHandler.h"
class CApplicationOperations : CFileItemHandler
{
public:
- static JSONRPC_STATUS GetProperties(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetProperties(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS SetVolume(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS SetMute(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS SetVolume(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS SetMute(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Quit(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Quit(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
private:
- static JSONRPC_STATUS GetPropertyValue(const CStdString &property, CVariant &result);
+ static JSONRPC_STATUS GetPropertyValue(const std::string &property, CVariant &result);
};
}
using namespace JSONRPC;
using namespace XFILE;
-JSONRPC_STATUS CAudioLibrary::GetArtists(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CAudioLibrary::GetArtists(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CMusicDatabase musicdatabase;
if (!musicdatabase.Open())
songID = (int)filter["songid"].asInteger();
else if (filter.isObject())
{
- CStdString xsp;
+ std::string xsp;
if (!GetXspFiltering("artists", filter, xsp))
return InvalidParams;
return OK;
}
-JSONRPC_STATUS CAudioLibrary::GetArtistDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CAudioLibrary::GetArtistDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int artistID = (int)parameterObject["artistid"].asInteger();
return OK;
}
-JSONRPC_STATUS CAudioLibrary::GetAlbums(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CAudioLibrary::GetAlbums(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CMusicDatabase musicdatabase;
if (!musicdatabase.Open())
musicUrl.AddOption("genre", filter["genre"].asString());
else if (filter.isObject())
{
- CStdString xsp;
+ std::string xsp;
if (!GetXspFiltering("albums", filter, xsp))
return InvalidParams;
return OK;
}
-JSONRPC_STATUS CAudioLibrary::GetAlbumDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CAudioLibrary::GetAlbumDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int albumID = (int)parameterObject["albumid"].asInteger();
if (!musicdatabase.GetAlbum(albumID, album, false))
return InvalidParams;
- CStdString path;
+ std::string path;
if (!musicdatabase.GetAlbumPath(albumID, path))
return InternalError;
return OK;
}
-JSONRPC_STATUS CAudioLibrary::GetSongs(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CAudioLibrary::GetSongs(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CMusicDatabase musicdatabase;
if (!musicdatabase.Open())
musicUrl.AddOption("album", filter["album"].asString());
else if (filter.isObject())
{
- CStdString xsp;
+ std::string xsp;
if (!GetXspFiltering("songs", filter, xsp))
return InvalidParams;
return OK;
}
-JSONRPC_STATUS CAudioLibrary::GetSongDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CAudioLibrary::GetSongDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int idSong = (int)parameterObject["songid"].asInteger();
return OK;
}
-JSONRPC_STATUS CAudioLibrary::GetRecentlyAddedAlbums(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CAudioLibrary::GetRecentlyAddedAlbums(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CMusicDatabase musicdatabase;
if (!musicdatabase.Open())
CFileItemList items;
for (unsigned int index = 0; index < albums.size(); index++)
{
- CStdString path = StringUtils::Format("musicdb://recentlyaddedalbums/%i/", albums[index].idAlbum);
+ std::string path = StringUtils::Format("musicdb://recentlyaddedalbums/%i/", albums[index].idAlbum);
CFileItemPtr item;
FillAlbumItem(albums[index], path, item);
return OK;
}
-JSONRPC_STATUS CAudioLibrary::GetRecentlyAddedSongs(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CAudioLibrary::GetRecentlyAddedSongs(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CMusicDatabase musicdatabase;
if (!musicdatabase.Open())
return OK;
}
-JSONRPC_STATUS CAudioLibrary::GetRecentlyPlayedAlbums(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CAudioLibrary::GetRecentlyPlayedAlbums(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CMusicDatabase musicdatabase;
if (!musicdatabase.Open())
CFileItemList items;
for (unsigned int index = 0; index < albums.size(); index++)
{
- CStdString path = StringUtils::Format("musicdb://recentlyplayedalbums/%i/", albums[index].idAlbum);
+ std::string path = StringUtils::Format("musicdb://recentlyplayedalbums/%i/", albums[index].idAlbum);
CFileItemPtr item;
FillAlbumItem(albums[index], path, item);
return OK;
}
-JSONRPC_STATUS CAudioLibrary::GetRecentlyPlayedSongs(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CAudioLibrary::GetRecentlyPlayedSongs(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CMusicDatabase musicdatabase;
if (!musicdatabase.Open())
return OK;
}
-JSONRPC_STATUS CAudioLibrary::GetGenres(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CAudioLibrary::GetGenres(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CMusicDatabase musicdatabase;
if (!musicdatabase.Open())
return OK;
}
-JSONRPC_STATUS CAudioLibrary::SetArtistDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CAudioLibrary::SetArtistDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int id = (int)parameterObject["artistid"].asInteger();
return ACK;
}
-JSONRPC_STATUS CAudioLibrary::SetAlbumDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CAudioLibrary::SetAlbumDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int id = (int)parameterObject["albumid"].asInteger();
return ACK;
}
-JSONRPC_STATUS CAudioLibrary::SetSongDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CAudioLibrary::SetSongDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int id = (int)parameterObject["songid"].asInteger();
return ACK;
}
-JSONRPC_STATUS CAudioLibrary::Scan(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CAudioLibrary::Scan(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
std::string directory = parameterObject["directory"].asString();
- CStdString cmd;
+ std::string cmd;
if (directory.empty())
cmd = "updatelibrary(music)";
else
return ACK;
}
-JSONRPC_STATUS CAudioLibrary::Export(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CAudioLibrary::Export(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
- CStdString cmd;
+ std::string cmd;
if (parameterObject["options"].isMember("path"))
cmd = StringUtils::Format("exportlibrary(music, false, %s)", StringUtils::Paramify(parameterObject["options"]["path"].asString()).c_str());
else
return ACK;
}
-JSONRPC_STATUS CAudioLibrary::Clean(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CAudioLibrary::Clean(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CApplicationMessenger::Get().ExecBuiltIn("cleanlibrary(music)");
return ACK;
}
-bool CAudioLibrary::FillFileItem(const CStdString &strFilename, CFileItemPtr &item, const CVariant ¶meterObject /* = CVariant(CVariant::VariantTypeArray) */)
+bool CAudioLibrary::FillFileItem(const std::string &strFilename, CFileItemPtr &item, const CVariant ¶meterObject /* = CVariant(CVariant::VariantTypeArray) */)
{
CMusicDatabase musicdatabase;
if (strFilename.empty())
if (!musicdatabase.Open())
return false;
- CStdString file = parameterObject["file"].asString();
+ std::string file = parameterObject["file"].asString();
int artistID = (int)parameterObject["artistid"].asInteger(-1);
int albumID = (int)parameterObject["albumid"].asInteger(-1);
int genreID = (int)parameterObject["genreid"].asInteger(-1);
return success;
}
-void CAudioLibrary::FillAlbumItem(const CAlbum &album, const CStdString &path, CFileItemPtr &item)
+void CAudioLibrary::FillAlbumItem(const CAlbum &album, const std::string &path, CFileItemPtr &item)
{
item = CFileItemPtr(new CFileItem(path, album));
}
#include <set>
-#include "utils/StdString.h"
#include "JSONRPC.h"
#include "FileItemHandler.h"
class CAudioLibrary : public CFileItemHandler
{
public:
- static JSONRPC_STATUS GetArtists(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetArtistDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetAlbums(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetAlbumDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetSongs(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetSongDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetGenres(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetArtists(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetArtistDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetAlbums(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetAlbumDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetSongs(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetSongDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetGenres(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetRecentlyAddedAlbums(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetRecentlyAddedSongs(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetRecentlyPlayedAlbums(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetRecentlyPlayedSongs(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetRecentlyAddedAlbums(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetRecentlyAddedSongs(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetRecentlyPlayedAlbums(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetRecentlyPlayedSongs(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS SetArtistDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS SetAlbumDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS SetSongDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS SetArtistDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS SetAlbumDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS SetSongDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Scan(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Export(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Clean(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Scan(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Export(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Clean(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static bool FillFileItem(const CStdString &strFilename, CFileItemPtr &item, const CVariant ¶meterObject = CVariant(CVariant::VariantTypeArray));
+ static bool FillFileItem(const std::string &strFilename, CFileItemPtr &item, const CVariant ¶meterObject = CVariant(CVariant::VariantTypeArray));
static bool FillFileItemList(const CVariant ¶meterObject, CFileItemList &list);
static JSONRPC_STATUS GetAdditionalAlbumDetails(const CVariant ¶meterObject, CFileItemList &items, CMusicDatabase &musicdatabase);
static JSONRPC_STATUS GetAdditionalSongDetails(const CVariant ¶meterObject, CFileItemList &items, CMusicDatabase &musicdatabase);
private:
- static void FillAlbumItem(const CAlbum &album, const CStdString &path, CFileItemPtr &item);
+ static void FillAlbumItem(const CAlbum &album, const std::string &path, CFileItemPtr &item);
static bool CheckForAdditionalProperties(const CVariant &properties, const std::set<std::string> &checkProperties, std::set<std::string> &foundProperties);
};
using namespace JSONRPC;
using namespace XFILE;
-JSONRPC_STATUS CFavouritesOperations::GetFavourites(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CFavouritesOperations::GetFavourites(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CFileItemList favourites;
CFavouritesDirectory::Load(favourites);
CVariant object;
CFileItemPtr item = favourites.Get(i);
- CStdString function;
+ std::string function;
vector<string> parameters;
CUtil::SplitExecFunction(item->GetPath(), function, parameters);
if (parameters.size() == 0)
return OK;
}
-JSONRPC_STATUS CFavouritesOperations::AddFavourite(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CFavouritesOperations::AddFavourite(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
string type = parameterObject["type"].asString();
class CFavouritesOperations : public CJSONUtils
{
public:
- static JSONRPC_STATUS GetFavourites(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS AddFavourite(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetFavourites(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS AddFavourite(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
};
}
CVideoLibrary::FillFileItemList(parameterObject, list);
CFileOperations::FillFileItemList(parameterObject, list);
- CStdString file = parameterObject["file"].asString();
+ std::string file = parameterObject["file"].asString();
if (!file.empty() && (URIUtils::IsURL(file) || (CFile::Exists(file) && !CDirectory::Exists(file))))
{
bool added = false;
#include "JSONRPC.h"
#include "JSONUtils.h"
#include "FileItem.h"
-#include "utils/StdString.h"
class CThumbLoader;
using namespace XFILE;
using namespace JSONRPC;
-JSONRPC_STATUS CFileOperations::GetRootDirectory(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CFileOperations::GetRootDirectory(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
- CStdString media = parameterObject["media"].asString();
+ std::string media = parameterObject["media"].asString();
StringUtils::ToLower(media);
VECSOURCES *sources = CMediaSourceSettings::Get().GetSources(media);
return OK;
}
-JSONRPC_STATUS CFileOperations::GetDirectory(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CFileOperations::GetDirectory(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
- CStdString media = parameterObject["media"].asString();
+ std::string media = parameterObject["media"].asString();
StringUtils::ToLower(media);
CFileItemList items;
- CStdString strPath = parameterObject["directory"].asString();
+ std::string strPath = parameterObject["directory"].asString();
if (!CFileUtils::RemoteAccessAllowed(strPath))
return InvalidParams;
std::vector<std::string> regexps;
- CStdString extensions = "";
- if (media.Equals("video"))
+ std::string extensions;
+ if (media == "video")
{
regexps = g_advancedSettings.m_videoExcludeFromListingRegExps;
extensions = g_advancedSettings.m_videoExtensions;
}
- else if (media.Equals("music"))
+ else if (media == "music")
{
regexps = g_advancedSettings.m_audioExcludeFromListingRegExps;
extensions = g_advancedSettings.m_musicExtensions;
}
- else if (media.Equals("pictures"))
+ else if (media == "pictures")
{
regexps = g_advancedSettings.m_pictureExcludeFromListingRegExps;
extensions = g_advancedSettings.m_pictureExtensions;
return InvalidParams;
}
-JSONRPC_STATUS CFileOperations::GetFileDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CFileOperations::GetFileDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
- CStdString file = parameterObject["file"].asString();
+ std::string file = parameterObject["file"].asString();
if (!CFile::Exists(file))
return InvalidParams;
if (!CFileUtils::RemoteAccessAllowed(file))
return InvalidParams;
- CStdString path = URIUtils::GetDirectory(file);
+ std::string path = URIUtils::GetDirectory(file);
CFileItemList items;
if (path.empty() || !CDirectory::GetDirectory(path, items) || !items.Contains(file))
return OK;
}
-JSONRPC_STATUS CFileOperations::PrepareDownload(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CFileOperations::PrepareDownload(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
std::string protocol;
if (transport->PrepareDownload(parameterObject["path"].asString().c_str(), result["details"], protocol))
return InvalidParams;
}
-JSONRPC_STATUS CFileOperations::Download(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CFileOperations::Download(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
return transport->Download(parameterObject["path"].asString().c_str(), result) ? OK : InvalidParams;
}
-bool CFileOperations::FillFileItem(const CFileItemPtr &originalItem, CFileItemPtr &item, CStdString media /* = "" */, const CVariant ¶meterObject /* = CVariant(CVariant::VariantTypeArray) */)
+bool CFileOperations::FillFileItem(const CFileItemPtr &originalItem, CFileItemPtr &item, std::string media /* = "" */, const CVariant ¶meterObject /* = CVariant(CVariant::VariantTypeArray) */)
{
if (originalItem.get() == NULL)
return false;
*item = *originalItem;
bool status = false;
- CStdString strFilename = originalItem->GetPath();
+ std::string strFilename = originalItem->GetPath();
if (!strFilename.empty() && (CDirectory::Exists(strFilename) || CFile::Exists(strFilename)))
{
- if (media.Equals("video"))
+ if (media == "video")
status = CVideoLibrary::FillFileItem(strFilename, item, parameterObject);
- else if (media.Equals("music"))
+ else if (media == "music")
status = CAudioLibrary::FillFileItem(strFilename, item, parameterObject);
if (status && item->GetLabel().empty())
{
- CStdString label = originalItem->GetLabel();
+ std::string label = originalItem->GetLabel();
if (label.empty())
{
bool isDir = CDirectory::Exists(strFilename);
if (originalItem->GetLabel().empty())
{
bool isDir = CDirectory::Exists(strFilename);
- CStdString label = CUtil::GetTitleFromPath(strFilename, isDir);
+ std::string label = CUtil::GetTitleFromPath(strFilename, isDir);
if (label.empty())
return false;
{
if (parameterObject.isMember("directory"))
{
- CStdString media = parameterObject["media"].asString();
+ std::string media = parameterObject["media"].asString();
StringUtils::ToLower(media);
- CStdString strPath = parameterObject["directory"].asString();
+ std::string strPath = parameterObject["directory"].asString();
if (!strPath.empty())
{
CFileItemList items;
- CStdString extensions = "";
+ std::string extensions;
std::vector<std::string> regexps;
- if (media.Equals("video"))
+ if (media == "video")
{
regexps = g_advancedSettings.m_videoExcludeFromListingRegExps;
extensions = g_advancedSettings.m_videoExtensions;
}
- else if (media.Equals("music"))
+ else if (media == "music")
{
regexps = g_advancedSettings.m_audioExcludeFromListingRegExps;
extensions = g_advancedSettings.m_musicExtensions;
}
- else if (media.Equals("pictures"))
+ else if (media == "pictures")
{
regexps = g_advancedSettings.m_pictureExcludeFromListingRegExps;
extensions = g_advancedSettings.m_pictureExtensions;
*
*/
-#include "utils/StdString.h"
#include "JSONRPC.h"
#include "FileItemHandler.h"
class CFileOperations : public CFileItemHandler
{
public:
- static JSONRPC_STATUS GetRootDirectory(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetDirectory(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetFileDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetRootDirectory(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetDirectory(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetFileDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS PrepareDownload(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Download(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS PrepareDownload(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Download(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static bool FillFileItem(const CFileItemPtr &originalItem, CFileItemPtr &item, CStdString media = "", const CVariant ¶meterObject = CVariant(CVariant::VariantTypeArray));
+ static bool FillFileItem(const CFileItemPtr &originalItem, CFileItemPtr &item, std::string media = "", const CVariant ¶meterObject = CVariant(CVariant::VariantTypeArray));
static bool FillFileItemList(const CVariant ¶meterObject, CFileItemList &list);
};
}
using namespace JSONRPC;
using namespace ADDON;
-JSONRPC_STATUS CGUIOperations::GetProperties(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CGUIOperations::GetProperties(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVariant properties = CVariant(CVariant::VariantTypeObject);
for (unsigned int index = 0; index < parameterObject["properties"].size(); index++)
{
- CStdString propertyName = parameterObject["properties"][index].asString();
+ std::string propertyName = parameterObject["properties"][index].asString();
CVariant property;
JSONRPC_STATUS ret;
if ((ret = GetPropertyValue(propertyName, property)) != OK)
return OK;
}
-JSONRPC_STATUS CGUIOperations::ActivateWindow(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CGUIOperations::ActivateWindow(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVariant params = parameterObject["parameters"];
std::string cmd = "ActivateWindow(" + parameterObject["window"].asString();
return ACK;
}
-JSONRPC_STATUS CGUIOperations::ShowNotification(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CGUIOperations::ShowNotification(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
string image = parameterObject["image"].asString();
string title = parameterObject["title"].asString();
return ACK;
}
-JSONRPC_STATUS CGUIOperations::SetFullscreen(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CGUIOperations::SetFullscreen(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
if ((parameterObject["fullscreen"].isString() &&
parameterObject["fullscreen"].asString().compare("toggle") == 0) ||
return GetPropertyValue("fullscreen", result);
}
-JSONRPC_STATUS CGUIOperations::SetStereoscopicMode(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CGUIOperations::SetStereoscopicMode(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CAction action = CStereoscopicsManager::Get().ConvertActionCommandToAction("SetStereoMode", parameterObject["mode"].asString());
if (action.GetID() != ACTION_NONE)
return InvalidParams;
}
-JSONRPC_STATUS CGUIOperations::GetStereoscopicModes(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CGUIOperations::GetStereoscopicModes(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
for (int i = RENDER_STEREO_MODE_OFF; i < RENDER_STEREO_MODE_COUNT; i++)
{
return OK;
}
-JSONRPC_STATUS CGUIOperations::GetPropertyValue(const CStdString &property, CVariant &result)
+JSONRPC_STATUS CGUIOperations::GetPropertyValue(const std::string &property, CVariant &result)
{
- if (property.Equals("currentwindow"))
+ if (property == "currentwindow")
{
result["label"] = g_infoManager.GetLabel(g_infoManager.TranslateString("System.CurrentWindow"));
result["id"] = g_windowManager.GetFocusedWindow();
}
- else if (property.Equals("currentcontrol"))
+ else if (property == "currentcontrol")
result["label"] = g_infoManager.GetLabel(g_infoManager.TranslateString("System.CurrentControl"));
- else if (property.Equals("skin"))
+ else if (property == "skin")
{
CStdString skinId = CSettings::Get().GetString("lookandfeel.skin");
AddonPtr addon;
if (addon.get())
result["name"] = addon->Name();
}
- else if (property.Equals("fullscreen"))
+ else if (property == "fullscreen")
result = g_application.IsFullScreen();
- else if (property.Equals("stereoscopicmode"))
+ else if (property == "stereoscopicmode")
result = GetStereoModeObjectFromGuiMode( CStereoscopicsManager::Get().GetStereoMode() );
else
return InvalidParams;
*/
#include "JSONRPC.h"
-#include "utils/StdString.h"
namespace JSONRPC
{
class CGUIOperations
{
public:
- static JSONRPC_STATUS GetProperties(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetProperties(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS ActivateWindow(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS ActivateWindow(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS ShowNotification(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS SetFullscreen(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS SetStereoscopicMode(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetStereoscopicModes(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS ShowNotification(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS SetFullscreen(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS SetStereoscopicMode(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetStereoscopicModes(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
private:
- static JSONRPC_STATUS GetPropertyValue(const CStdString &property, CVariant &result);
+ static JSONRPC_STATUS GetPropertyValue(const std::string &property, CVariant &result);
static CVariant GetStereoModeObjectFromGuiMode(const RENDER_STEREO_MODE &mode);
};
}
return ACK;
}
-JSONRPC_STATUS CInputOperations::SendText(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CInputOperations::SendText(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CApplicationMessenger::Get().SendText(parameterObject["text"].asString(), parameterObject["done"].asBoolean());
return ACK;
}
-JSONRPC_STATUS CInputOperations::ExecuteAction(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CInputOperations::ExecuteAction(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int action;
if (!CButtonTranslator::TranslateActionString(parameterObject["action"].asString().c_str(), action))
return SendAction(action);
}
-JSONRPC_STATUS CInputOperations::Left(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CInputOperations::Left(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
return SendAction(ACTION_MOVE_LEFT);
}
-JSONRPC_STATUS CInputOperations::Right(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CInputOperations::Right(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
return SendAction(ACTION_MOVE_RIGHT);
}
-JSONRPC_STATUS CInputOperations::Down(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CInputOperations::Down(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
return SendAction(ACTION_MOVE_DOWN);
}
-JSONRPC_STATUS CInputOperations::Up(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CInputOperations::Up(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
return SendAction(ACTION_MOVE_UP);
}
-JSONRPC_STATUS CInputOperations::Select(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CInputOperations::Select(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
return SendAction(ACTION_SELECT_ITEM);
}
-JSONRPC_STATUS CInputOperations::Back(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CInputOperations::Back(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
return SendAction(ACTION_NAV_BACK);
}
-JSONRPC_STATUS CInputOperations::ContextMenu(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CInputOperations::ContextMenu(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
return SendAction(ACTION_CONTEXT_MENU);
}
-JSONRPC_STATUS CInputOperations::Info(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CInputOperations::Info(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
return SendAction(ACTION_SHOW_INFO);
}
-JSONRPC_STATUS CInputOperations::Home(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CInputOperations::Home(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
return activateWindow(WINDOW_HOME);
}
-JSONRPC_STATUS CInputOperations::ShowCodec(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CInputOperations::ShowCodec(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
return SendAction(ACTION_SHOW_CODEC);
}
-JSONRPC_STATUS CInputOperations::ShowOSD(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CInputOperations::ShowOSD(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
return SendAction(ACTION_SHOW_OSD);
}
#include "JSONRPC.h"
#include "guilib/Key.h"
#include "threads/CriticalSection.h"
-#include "utils/StdString.h"
namespace JSONRPC
{
class CInputOperations
{
public:
- static JSONRPC_STATUS SendText(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS ExecuteAction(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS SendText(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS ExecuteAction(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Left(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Right(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Down(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Up(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Left(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Right(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Down(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Up(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Select(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Back(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS ContextMenu(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Info(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Home(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Select(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Back(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS ContextMenu(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Info(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Home(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS ShowCodec(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS ShowOSD(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS ShowCodec(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS ShowOSD(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
static JSONRPC_STATUS SendAction(int actionID, bool wakeScreensaver = true, bool waitResult = false);
m_initialized = false;
}
-JSONRPC_STATUS CJSONRPC::Introspect(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
+JSONRPC_STATUS CJSONRPC::Introspect(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
{
return CJSONServiceDescription::Print(result, transport, client,
parameterObject["getdescriptions"].asBoolean(), parameterObject["getmetadata"].asBoolean(), parameterObject["filterbytransport"].asBoolean(),
parameterObject["filter"]["id"].asString(), parameterObject["filter"]["type"].asString(), parameterObject["filter"]["getreferences"].asBoolean());
}
-JSONRPC_STATUS CJSONRPC::Version(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
+JSONRPC_STATUS CJSONRPC::Version(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
{
result["version"]["major"] = 0;
result["version"]["minor"] = 0;
return OK;
}
-JSONRPC_STATUS CJSONRPC::Permission(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
+JSONRPC_STATUS CJSONRPC::Permission(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
{
int flags = client->GetPermissionFlags();
return OK;
}
-JSONRPC_STATUS CJSONRPC::Ping(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
+JSONRPC_STATUS CJSONRPC::Ping(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
{
CVariant temp = "pong";
result.swap(temp);
return OK;
}
-JSONRPC_STATUS CJSONRPC::GetConfiguration(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
+JSONRPC_STATUS CJSONRPC::GetConfiguration(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
{
int flags = client->GetAnnouncementFlags();
return OK;
}
-JSONRPC_STATUS CJSONRPC::SetConfiguration(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
+JSONRPC_STATUS CJSONRPC::SetConfiguration(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
{
int flags = 0;
int oldFlags = client->GetAnnouncementFlags();
return GetConfiguration(method, transport, client, parameterObject, result);
}
-JSONRPC_STATUS CJSONRPC::NotifyAll(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
+JSONRPC_STATUS CJSONRPC::NotifyAll(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
{
if (parameterObject["data"].isNull())
CAnnouncementManager::Get().Announce(Other, parameterObject["sender"].asString().c_str(),
return ACK;
}
-CStdString CJSONRPC::MethodCall(const CStdString &inputString, ITransportLayer *transport, IClient *client)
+std::string CJSONRPC::MethodCall(const std::string &inputString, ITransportLayer *transport, IClient *client)
{
CVariant inputroot, outputroot, result;
bool hasResponse = false;
hasResponse = true;
}
- CStdString str = hasResponse ? CJSONVariantWriter::Write(outputroot, g_advancedSettings.m_jsonOutputCompact) : "";
+ std::string str = hasResponse ? CJSONVariantWriter::Write(outputroot, g_advancedSettings.m_jsonOutputCompact) : "";
return str;
}
{
isNotification = !request.isMember("id");
- CStdString methodName = request["method"].asString();
+ std::string methodName = request["method"].asString();
StringUtils::ToLower(methodName);
JSONRPC::MethodCall method;
CVariant params;
- if ((errorCode = CJSONServiceDescription::CheckCall(methodName, request["params"], transport, client, isNotification, method, params)) == OK)
+ if ((errorCode = CJSONServiceDescription::CheckCall(methodName.c_str(), request["params"], transport, client, isNotification, method, params)) == OK)
errorCode = method(methodName, transport, client, params, result);
else
result = params;
#include "JSONRPCUtils.h"
#include "JSONServiceDescription.h"
#include "interfaces/IAnnouncer.h"
-#include "utils/StdString.h"
namespace JSONRPC
{
in the request are checked for validity and completeness. If the request
is valid and the requested method exists it is called and executed.
*/
- static CStdString MethodCall(const CStdString &inputString, ITransportLayer *transport, IClient *client);
+ static std::string MethodCall(const std::string &inputString, ITransportLayer *transport, IClient *client);
- static JSONRPC_STATUS Introspect(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
- static JSONRPC_STATUS Version(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
- static JSONRPC_STATUS Permission(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
- static JSONRPC_STATUS Ping(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
- static JSONRPC_STATUS GetConfiguration(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
- static JSONRPC_STATUS SetConfiguration(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
- static JSONRPC_STATUS NotifyAll(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
+ static JSONRPC_STATUS Introspect(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
+ static JSONRPC_STATUS Version(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
+ static JSONRPC_STATUS Permission(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
+ static JSONRPC_STATUS Ping(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
+ static JSONRPC_STATUS GetConfiguration(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
+ static JSONRPC_STATUS SetConfiguration(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
+ static JSONRPC_STATUS NotifyAll(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
private:
static void setup();
#include "GUIUserMessages.h"
#include "guilib/GUIWindowManager.h"
#include "interfaces/IAnnouncer.h"
-#include "utils/StdString.h"
#include "utils/Variant.h"
namespace JSONRPC
/*!
\brief Function pointer for JSON-RPC methods
*/
- typedef JSONRPC_STATUS (*MethodCall) (const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
+ typedef JSONRPC_STATUS (*MethodCall) (const std::string &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
/*!
\ingroup jsonrpc
#include "ServiceDescription.h"
#include "JSONServiceDescription.h"
#include "utils/log.h"
-#include "utils/StdString.h"
#include "utils/JSONVariantParser.h"
#include "utils/StringUtils.h"
#include "JSONRPC.h"
if (!name.empty())
errorData["name"] = name;
SchemaValueTypeToJson(type, errorData["type"]);
- CStdString errorMessage;
+ std::string errorMessage;
if (referencedType != NULL && !referencedTypeSet)
Set(referencedType);
void JSONSchemaTypeDefinition::CJsonSchemaPropertiesMap::add(JSONSchemaTypeDefinitionPtr property)
{
- CStdString name = property->name;
+ std::string name = property->name;
StringUtils::ToLower(name);
m_propertiesmap[name] = property;
}
if (filterByName.size() > 0)
{
- CStdString name = filterByName;
+ std::string name = filterByName;
if (filterByType == "method")
{
void CJSONServiceDescription::CJsonRpcMethodMap::add(const JsonRpcMethod &method)
{
- CStdString name = method.name;
+ std::string name = method.name;
StringUtils::ToLower(name);
m_actionmap[name] = method;
}
static bool ParseSorting(const CVariant ¶meterObject, SortBy &sortBy, SortOrder &sortOrder, SortAttribute &sortAttributes)
{
- CStdString method = parameterObject["sort"]["method"].asString();
- CStdString order = parameterObject["sort"]["order"].asString();
+ std::string method = parameterObject["sort"]["method"].asString();
+ std::string order = parameterObject["sort"]["order"].asString();
StringUtils::ToLower(method);
StringUtils::ToLower(order);
else
sortAttributes = SortAttributeNone;
- if (order.Equals("ascending"))
+ if (order == "ascending")
sortOrder = SortOrderAscending;
- else if (order.Equals("descending"))
+ else if (order == "descending")
sortOrder = SortOrderDescending;
else
return false;
- if (method.Equals("none"))
+ if (method == "none")
sortBy = SortByNone;
- else if (method.Equals("label"))
+ else if (method == "label")
sortBy = SortByLabel;
- else if (method.Equals("date"))
+ else if (method == "date")
sortBy = SortByDate;
- else if (method.Equals("size"))
+ else if (method == "size")
sortBy = SortBySize;
- else if (method.Equals("file"))
+ else if (method == "file")
sortBy = SortByFile;
- else if (method.Equals("path"))
+ else if (method == "path")
sortBy = SortByPath;
- else if (method.Equals("drivetype"))
+ else if (method == "drivetype")
sortBy = SortByDriveType;
- else if (method.Equals("title"))
+ else if (method == "title")
sortBy = SortByTitle;
- else if (method.Equals("track"))
+ else if (method == "track")
sortBy = SortByTrackNumber;
- else if (method.Equals("time"))
+ else if (method == "time")
sortBy = SortByTime;
- else if (method.Equals("artist"))
+ else if (method == "artist")
sortBy = SortByArtist;
- else if (method.Equals("album"))
+ else if (method == "album")
sortBy = SortByAlbum;
- else if (method.Equals("albumtype"))
+ else if (method == "albumtype")
sortBy = SortByAlbumType;
- else if (method.Equals("genre"))
+ else if (method == "genre")
sortBy = SortByGenre;
- else if (method.Equals("country"))
+ else if (method == "country")
sortBy = SortByCountry;
- else if (method.Equals("year"))
+ else if (method == "year")
sortBy = SortByYear;
- else if (method.Equals("rating"))
+ else if (method == "rating")
sortBy = SortByRating;
- else if (method.Equals("votes"))
+ else if (method == "votes")
sortBy = SortByVotes;
- else if (method.Equals("top250"))
+ else if (method == "top250")
sortBy = SortByTop250;
- else if (method.Equals("programcount"))
+ else if (method == "programcount")
sortBy = SortByProgramCount;
- else if (method.Equals("playlist"))
+ else if (method == "playlist")
sortBy = SortByPlaylistOrder;
- else if (method.Equals("episode"))
+ else if (method == "episode")
sortBy = SortByEpisodeNumber;
- else if (method.Equals("season"))
+ else if (method == "season")
sortBy = SortBySeason;
- else if (method.Equals("totalepisodes"))
+ else if (method == "totalepisodes")
sortBy = SortByNumberOfEpisodes;
- else if (method.Equals("watchedepisodes"))
+ else if (method == "watchedepisodes")
sortBy = SortByNumberOfWatchedEpisodes;
- else if (method.Equals("tvshowstatus"))
+ else if (method == "tvshowstatus")
sortBy = SortByTvShowStatus;
- else if (method.Equals("tvshowtitle"))
+ else if (method == "tvshowtitle")
sortBy = SortByTvShowTitle;
- else if (method.Equals("sorttitle"))
+ else if (method == "sorttitle")
sortBy = SortBySortTitle;
- else if (method.Equals("productioncode"))
+ else if (method == "productioncode")
sortBy = SortByProductionCode;
- else if (method.Equals("mpaa"))
+ else if (method == "mpaa")
sortBy = SortByMPAA;
- else if (method.Equals("studio"))
+ else if (method == "studio")
sortBy = SortByStudio;
- else if (method.Equals("dateadded"))
+ else if (method == "dateadded")
sortBy = SortByDateAdded;
- else if (method.Equals("lastplayed"))
+ else if (method == "lastplayed")
sortBy = SortByLastPlayed;
- else if (method.Equals("playcount"))
+ else if (method == "playcount")
sortBy = SortByPlaycount;
- else if (method.Equals("listeners"))
+ else if (method == "listeners")
sortBy = SortByListeners;
- else if (method.Equals("bitrate"))
+ else if (method == "bitrate")
sortBy = SortByBitrate;
- else if (method.Equals("random"))
+ else if (method == "random")
sortBy = SortByRandom;
else
return false;
date.SetFromDBDateTime(jsonDate.asString());
}
- static bool GetXspFiltering(const CStdString &type, const CVariant &filter, CStdString &xsp)
+ static bool GetXspFiltering(const std::string &type, const CVariant &filter, std::string &xsp)
{
if (type.empty() || !filter.isObject())
return false;
using namespace PVR;
using namespace EPG;
-JSONRPC_STATUS CPVROperations::GetProperties(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPVROperations::GetProperties(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
if (!g_PVRManager.IsStarted())
return FailedToExecute;
CVariant properties = CVariant(CVariant::VariantTypeObject);
for (unsigned int index = 0; index < parameterObject["properties"].size(); index++)
{
- CStdString propertyName = parameterObject["properties"][index].asString();
+ std::string propertyName = parameterObject["properties"][index].asString();
CVariant property;
JSONRPC_STATUS ret;
if ((ret = GetPropertyValue(propertyName, property)) != OK)
return OK;
}
-JSONRPC_STATUS CPVROperations::GetChannelGroups(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPVROperations::GetChannelGroups(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
if (!g_PVRManager.IsStarted())
return FailedToExecute;
return OK;
}
-JSONRPC_STATUS CPVROperations::GetChannelGroupDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPVROperations::GetChannelGroupDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
if (!g_PVRManager.IsStarted())
return FailedToExecute;
return OK;
}
-JSONRPC_STATUS CPVROperations::GetChannels(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPVROperations::GetChannels(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
if (!g_PVRManager.IsStarted())
return FailedToExecute;
return OK;
}
-JSONRPC_STATUS CPVROperations::GetChannelDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPVROperations::GetChannelDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
if (!g_PVRManager.IsStarted())
return FailedToExecute;
return OK;
}
-JSONRPC_STATUS CPVROperations::GetBroadcasts(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPVROperations::GetBroadcasts(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
if (!g_PVRManager.IsStarted())
return FailedToExecute;
return OK;
}
-JSONRPC_STATUS CPVROperations::GetBroadcastDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPVROperations::GetBroadcastDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
if (!g_PVRManager.IsStarted())
return FailedToExecute;
}
-JSONRPC_STATUS CPVROperations::Record(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPVROperations::Record(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
if (!g_PVRManager.IsStarted())
return FailedToExecute;
return ACK;
}
-JSONRPC_STATUS CPVROperations::Scan(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPVROperations::Scan(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
if (!g_PVRManager.IsStarted())
return FailedToExecute;
return ACK;
}
-JSONRPC_STATUS CPVROperations::GetPropertyValue(const CStdString &property, CVariant &result)
+JSONRPC_STATUS CPVROperations::GetPropertyValue(const std::string &property, CVariant &result)
{
bool started = g_PVRManager.IsStarted();
- if (property.Equals("available"))
+ if (property == "available")
result = started;
- else if (property.Equals("recording"))
+ else if (property == "recording")
{
if (started)
result = g_PVRManager.IsRecording();
else
result = false;
}
- else if (property.Equals("scanning"))
+ else if (property == "scanning")
{
if (started)
result = g_PVRManager.IsRunningChannelScan();
}
}
-JSONRPC_STATUS CPVROperations::GetTimers(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPVROperations::GetTimers(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
if (!g_PVRManager.IsStarted())
return FailedToExecute;
return OK;
}
-JSONRPC_STATUS CPVROperations::GetTimerDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPVROperations::GetTimerDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
if (!g_PVRManager.IsStarted())
return FailedToExecute;
return OK;
}
-JSONRPC_STATUS CPVROperations::GetRecordings(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPVROperations::GetRecordings(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
if (!g_PVRManager.IsStarted())
return FailedToExecute;
return OK;
}
-JSONRPC_STATUS CPVROperations::GetRecordingDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPVROperations::GetRecordingDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
if (!g_PVRManager.IsStarted())
return FailedToExecute;
*/
#include "FileItemHandler.h"
-#include "utils/StdString.h"
#include "pvr/channels/PVRChannelGroup.h"
namespace JSONRPC
class CPVROperations : public CFileItemHandler
{
public:
- static JSONRPC_STATUS GetProperties(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetChannelGroups(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetChannelGroupDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetChannels(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetChannelDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetBroadcasts(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetBroadcastDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetTimers(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetTimerDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetRecordings(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetRecordingDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetProperties(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetChannelGroups(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetChannelGroupDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetChannels(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetChannelDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetBroadcasts(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetBroadcastDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetTimers(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetTimerDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetRecordings(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetRecordingDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Record(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Scan(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Record(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Scan(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
private:
- static JSONRPC_STATUS GetPropertyValue(const CStdString &property, CVariant &result);
+ static JSONRPC_STATUS GetPropertyValue(const std::string &property, CVariant &result);
static void FillChannelGroupDetails(const PVR::CPVRChannelGroupPtr &channelGroup, const CVariant ¶meterObject, CVariant &result, bool append = false);
};
}
using namespace PLAYLIST;
using namespace PVR;
-JSONRPC_STATUS CPlayerOperations::GetActivePlayers(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlayerOperations::GetActivePlayers(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int activePlayers = GetActivePlayers();
result = CVariant(CVariant::VariantTypeArray);
return OK;
}
-JSONRPC_STATUS CPlayerOperations::GetProperties(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlayerOperations::GetProperties(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
PlayerType player = GetPlayer(parameterObject["playerid"]);
CVariant properties = CVariant(CVariant::VariantTypeObject);
for (unsigned int index = 0; index < parameterObject["properties"].size(); index++)
{
- CStdString propertyName = parameterObject["properties"][index].asString();
+ std::string propertyName = parameterObject["properties"][index].asString();
CVariant property;
JSONRPC_STATUS ret;
if ((ret = GetPropertyValue(player, propertyName, property)) != OK)
return OK;
}
-JSONRPC_STATUS CPlayerOperations::GetItem(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlayerOperations::GetItem(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
PlayerType player = GetPlayer(parameterObject["playerid"]);
CFileItemPtr fileItem;
const CVideoInfoTag *currentVideoTag = g_infoManager.GetCurrentMovieTag();
if (currentVideoTag != NULL)
{
- CStdString originalLabel = fileItem->GetLabel();
+ std::string originalLabel = fileItem->GetLabel();
fileItem->SetFromVideoInfoTag(*currentVideoTag);
if (fileItem->GetLabel().empty())
fileItem->SetLabel(originalLabel);
const MUSIC_INFO::CMusicInfoTag *currentMusicTag = g_infoManager.GetCurrentSongTag();
if (currentMusicTag != NULL)
{
- CStdString originalLabel = fileItem->GetLabel();
+ std::string originalLabel = fileItem->GetLabel();
fileItem = CFileItemPtr(new CFileItem(*currentMusicTag));
if (fileItem->GetLabel().empty())
fileItem->SetLabel(originalLabel);
bool additionalInfo = false;
for (CVariant::const_iterator_array itr = parameterObject["properties"].begin_array(); itr != parameterObject["properties"].end_array(); itr++)
{
- CStdString fieldValue = itr->asString();
+ std::string fieldValue = itr->asString();
if (fieldValue == "cast" || fieldValue == "set" || fieldValue == "setid" || fieldValue == "showlink" || fieldValue == "resume" ||
(fieldValue == "streamdetails" && !fileItem->GetVideoInfoTag()->m_streamDetails.HasItems()))
additionalInfo = true;
return OK;
}
-JSONRPC_STATUS CPlayerOperations::PlayPause(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlayerOperations::PlayPause(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CGUIWindowSlideShow *slideshow = NULL;
switch (GetPlayer(parameterObject["playerid"]))
}
}
-JSONRPC_STATUS CPlayerOperations::Stop(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlayerOperations::Stop(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
switch (GetPlayer(parameterObject["playerid"]))
{
}
}
-JSONRPC_STATUS CPlayerOperations::SetSpeed(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlayerOperations::SetSpeed(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
switch (GetPlayer(parameterObject["playerid"]))
{
}
}
-JSONRPC_STATUS CPlayerOperations::Seek(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlayerOperations::Seek(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
PlayerType player = GetPlayer(parameterObject["playerid"]);
switch (player)
g_application.SeekPercentage(parameterObject["value"].asFloat());
else if (parameterObject["value"].isString())
{
- CStdString step = parameterObject["value"].asString();
- if (step.Equals("smallforward"))
+ std::string step = parameterObject["value"].asString();
+ if (step == "smallforward")
CBuiltins::Execute("playercontrol(smallskipforward)");
- else if (step.Equals("smallbackward"))
+ else if (step == "smallbackward")
CBuiltins::Execute("playercontrol(smallskipbackward)");
- else if (step.Equals("bigforward"))
+ else if (step == "bigforward")
CBuiltins::Execute("playercontrol(bigskipforward)");
- else if (step.Equals("bigbackward"))
+ else if (step == "bigbackward")
CBuiltins::Execute("playercontrol(bigskipbackward)");
else
return InvalidParams;
}
}
-JSONRPC_STATUS CPlayerOperations::Move(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlayerOperations::Move(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
std::string direction = parameterObject["direction"].asString();
switch (GetPlayer(parameterObject["playerid"]))
}
}
-JSONRPC_STATUS CPlayerOperations::Zoom(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlayerOperations::Zoom(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVariant zoom = parameterObject["zoom"];
switch (GetPlayer(parameterObject["playerid"]))
}
}
-JSONRPC_STATUS CPlayerOperations::Rotate(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlayerOperations::Rotate(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
switch (GetPlayer(parameterObject["playerid"]))
{
}
}
-JSONRPC_STATUS CPlayerOperations::Open(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlayerOperations::Open(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVariant optionShuffled = parameterObject["options"]["shuffled"];
CVariant optionRepeat = parameterObject["options"]["repeat"];
return InvalidParams;
}
-JSONRPC_STATUS CPlayerOperations::GoTo(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlayerOperations::GoTo(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVariant to = parameterObject["to"];
switch (GetPlayer(parameterObject["playerid"]))
return ACK;
}
-JSONRPC_STATUS CPlayerOperations::SetShuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlayerOperations::SetShuffle(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CGUIWindowSlideShow *slideshow = NULL;
CVariant shuffle = parameterObject["shuffle"];
return ACK;
}
-JSONRPC_STATUS CPlayerOperations::SetRepeat(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlayerOperations::SetRepeat(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
switch (GetPlayer(parameterObject["playerid"]))
{
return ACK;
}
-JSONRPC_STATUS CPlayerOperations::SetPartymode(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlayerOperations::SetPartymode(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
PlayerType player = GetPlayer(parameterObject["playerid"]);
switch (player)
return ACK;
}
-JSONRPC_STATUS CPlayerOperations::SetAudioStream(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlayerOperations::SetAudioStream(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
switch (GetPlayer(parameterObject["playerid"]))
{
return ACK;
}
-JSONRPC_STATUS CPlayerOperations::SetSubtitle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlayerOperations::SetSubtitle(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
switch (GetPlayer(parameterObject["playerid"]))
{
g_windowManager.SendThreadMessage(msg);
}
-JSONRPC_STATUS CPlayerOperations::GetPropertyValue(PlayerType player, const CStdString &property, CVariant &result)
+JSONRPC_STATUS CPlayerOperations::GetPropertyValue(PlayerType player, const std::string &property, CVariant &result)
{
if (player == None)
return FailedToExecute;
int playlist = GetPlaylist(player);
- if (property.Equals("type"))
+ if (property == "type")
{
switch (player)
{
return FailedToExecute;
}
}
- else if (property.Equals("partymode"))
+ else if (property == "partymode")
{
switch (player)
{
return FailedToExecute;
}
}
- else if (property.Equals("speed"))
+ else if (property == "speed")
{
CGUIWindowSlideShow *slideshow = NULL;
switch (player)
return FailedToExecute;
}
}
- else if (property.Equals("time"))
+ else if (property == "time")
{
switch (player)
{
return FailedToExecute;
}
}
- else if (property.Equals("percentage"))
+ else if (property == "percentage")
{
CGUIWindowSlideShow *slideshow = NULL;
switch (player)
return FailedToExecute;
}
}
- else if (property.Equals("totaltime"))
+ else if (property == "totaltime")
{
switch (player)
{
return FailedToExecute;
}
}
- else if (property.Equals("playlistid"))
+ else if (property == "playlistid")
{
result = playlist;
}
- else if (property.Equals("position"))
+ else if (property == "position")
{
CGUIWindowSlideShow *slideshow = NULL;
switch (player)
break;
}
}
- else if (property.Equals("repeat"))
+ else if (property == "repeat")
{
switch (player)
{
break;
}
}
- else if (property.Equals("shuffled"))
+ else if (property == "shuffled")
{
CGUIWindowSlideShow *slideshow = NULL;
switch (player)
break;
}
}
- else if (property.Equals("canseek"))
+ else if (property == "canseek")
{
switch (player)
{
break;
}
}
- else if (property.Equals("canchangespeed"))
+ else if (property == "canchangespeed")
{
switch (player)
{
break;
}
}
- else if (property.Equals("canmove"))
+ else if (property == "canmove")
{
switch (player)
{
break;
}
}
- else if (property.Equals("canzoom"))
+ else if (property == "canzoom")
{
switch (player)
{
break;
}
}
- else if (property.Equals("canrotate"))
+ else if (property == "canrotate")
{
switch (player)
{
break;
}
}
- else if (property.Equals("canshuffle"))
+ else if (property == "canshuffle")
{
switch (player)
{
break;
}
}
- else if (property.Equals("canrepeat"))
+ else if (property == "canrepeat")
{
switch (player)
{
break;
}
}
- else if (property.Equals("currentaudiostream"))
+ else if (property == "currentaudiostream")
{
switch (player)
{
break;
}
}
- else if (property.Equals("audiostreams"))
+ else if (property == "audiostreams")
{
result = CVariant(CVariant::VariantTypeArray);
switch (player)
break;
}
}
- else if (property.Equals("subtitleenabled"))
+ else if (property == "subtitleenabled")
{
switch (player)
{
break;
}
}
- else if (property.Equals("currentsubtitle"))
+ else if (property == "currentsubtitle")
{
switch (player)
{
break;
}
}
- else if (property.Equals("subtitles"))
+ else if (property == "subtitles")
{
result = CVariant(CVariant::VariantTypeArray);
switch (player)
break;
}
}
- else if (property.Equals("live"))
+ else if (property == "live")
result = IsPVRChannel();
else
return InvalidParams;
*
*/
-#include "utils/StdString.h"
#include "JSONRPC.h"
#include "FileItemHandler.h"
class CPlayerOperations : CFileItemHandler
{
public:
- static JSONRPC_STATUS GetActivePlayers(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetProperties(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetItem(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetActivePlayers(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetProperties(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetItem(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS PlayPause(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Stop(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS SetSpeed(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Seek(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS PlayPause(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Stop(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS SetSpeed(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Seek(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Move(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Zoom(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Rotate(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Move(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Zoom(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Rotate(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Open(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GoTo(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS SetShuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS SetRepeat(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS SetPartymode(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Open(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GoTo(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS SetShuffle(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS SetRepeat(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS SetPartymode(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS SetAudioStream(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS SetSubtitle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS SetAudioStream(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS SetSubtitle(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
private:
static int GetActivePlayers();
static PlayerType GetPlayer(const CVariant &player);
static JSONRPC_STATUS StartSlideshow(const std::string& path, bool recursive, bool random);
static void SendSlideshowAction(int actionID);
static void OnPlaylistChanged();
- static JSONRPC_STATUS GetPropertyValue(PlayerType player, const CStdString &property, CVariant &result);
+ static JSONRPC_STATUS GetPropertyValue(PlayerType player, const std::string &property, CVariant &result);
static int ParseRepeatState(const CVariant &repeat);
static double ParseTimeInSeconds(const CVariant &time);
using namespace PLAYLIST;
using namespace std;
-JSONRPC_STATUS CPlaylistOperations::GetPlaylists(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlaylistOperations::GetPlaylists(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
result = CVariant(CVariant::VariantTypeArray);
CVariant playlist = CVariant(CVariant::VariantTypeObject);
return OK;
}
-JSONRPC_STATUS CPlaylistOperations::GetProperties(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlaylistOperations::GetProperties(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int playlist = GetPlaylist(parameterObject["playlistid"]);
for (unsigned int index = 0; index < parameterObject["properties"].size(); index++)
{
- CStdString propertyName = parameterObject["properties"][index].asString();
+ std::string propertyName = parameterObject["properties"][index].asString();
CVariant property;
JSONRPC_STATUS ret;
if ((ret = GetPropertyValue(playlist, propertyName, property)) != OK)
return OK;
}
-JSONRPC_STATUS CPlaylistOperations::GetItems(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlaylistOperations::GetItems(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CFileItemList list;
int playlist = GetPlaylist(parameterObject["playlistid"]);
return true;
}
-JSONRPC_STATUS CPlaylistOperations::Add(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlaylistOperations::Add(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int playlist = GetPlaylist(parameterObject["playlistid"]);
return ACK;
}
-JSONRPC_STATUS CPlaylistOperations::Insert(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlaylistOperations::Insert(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int playlist = GetPlaylist(parameterObject["playlistid"]);
if (playlist == PLAYLIST_PICTURE)
return ACK;
}
-JSONRPC_STATUS CPlaylistOperations::Remove(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlaylistOperations::Remove(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int playlist = GetPlaylist(parameterObject["playlistid"]);
if (playlist == PLAYLIST_PICTURE)
return ACK;
}
-JSONRPC_STATUS CPlaylistOperations::Clear(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlaylistOperations::Clear(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int playlist = GetPlaylist(parameterObject["playlistid"]);
CGUIWindowSlideShow *slideshow = NULL;
return ACK;
}
-JSONRPC_STATUS CPlaylistOperations::Swap(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CPlaylistOperations::Swap(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int playlist = GetPlaylist(parameterObject["playlistid"]);
if (playlist == PLAYLIST_PICTURE)
g_windowManager.SendThreadMessage(msg);
}
-JSONRPC_STATUS CPlaylistOperations::GetPropertyValue(int playlist, const CStdString &property, CVariant &result)
+JSONRPC_STATUS CPlaylistOperations::GetPropertyValue(int playlist, const std::string &property, CVariant &result)
{
- if (property.Equals("type"))
+ if (property == "type")
{
switch (playlist)
{
break;
}
}
- else if (property.Equals("size"))
+ else if (property == "size")
{
CFileItemList list;
CGUIWindowSlideShow *slideshow = NULL;
-#pragma once
/*
* Copyright (C) 2005-2013 Team XBMC
* http://xbmc.org
*
*/
-#include "utils/StdString.h"
#include "JSONRPC.h"
#include "FileItemHandler.h"
#include "FileItem.h"
class CPlaylistOperations : public CFileItemHandler
{
public:
- static JSONRPC_STATUS GetPlaylists(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetProperties(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetPlaylists(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetProperties(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetItems(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Add(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Remove(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Insert(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Clear(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Swap(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetItems(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Add(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Remove(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Insert(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Clear(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Swap(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
private:
static int GetPlaylist(const CVariant &playlist);
static inline void NotifyAll();
- static JSONRPC_STATUS GetPropertyValue(int playlist, const CStdString &property, CVariant &result);
+ static JSONRPC_STATUS GetPropertyValue(int playlist, const std::string &property, CVariant &result);
static bool CheckMediaParameter(int playlist, const CVariant &itemObject);
static bool HandleItemsParameter(int playlistid, const CVariant &itemParam, CFileItemList &items);
};
using namespace JSONRPC;
-JSONRPC_STATUS CProfilesOperations::GetProfiles(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CProfilesOperations::GetProfiles(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CFileItemList listItems;
{
for (CVariant::iterator_array profileiter = result["profiles"].begin_array(); profileiter != result["profiles"].end_array(); ++profileiter)
{
- CStdString profilename = (*profileiter)["label"].asString();
+ std::string profilename = (*profileiter)["label"].asString();
int index = CProfilesManager::Get().GetProfileIndex(profilename);
const CProfile *profile = CProfilesManager::Get().GetProfile(index);
LockType locktype = LOCK_MODE_UNKNOWN;
return OK;
}
-JSONRPC_STATUS CProfilesOperations::GetCurrentProfile(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CProfilesOperations::GetCurrentProfile(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
const CProfile& currentProfile = CProfilesManager::Get().GetCurrentProfile();
CVariant profileVariant = CVariant(CVariant::VariantTypeObject);
return OK;
}
-JSONRPC_STATUS CProfilesOperations::LoadProfile(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CProfilesOperations::LoadProfile(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
- CStdString profilename = parameterObject["profile"].asString();
+ std::string profilename = parameterObject["profile"].asString();
int index = CProfilesManager::Get().GetProfileIndex(profilename);
if (index < 0)
else if (!bCanceled && parameterObject.isMember("password")) // Password needed and user provided it
{
const CVariant &passwordObject = parameterObject["password"];
- CStdString strToVerify; // Holds user saved password hash
+ std::string strToVerify; // Holds user saved password hash
if (index == 0)
strToVerify = CProfilesManager::Get().GetMasterProfile().getLockCode();
else
strToVerify = profile->getLockCode();
}
- CStdString password = passwordObject["value"].asString();
+ std::string password = passwordObject["value"].asString();
// Create password hash from the provided password if md5 is not used
- CStdString md5pword2;
- CStdString encryption = passwordObject["encryption"].asString();
- if (encryption.Equals("none"))
+ std::string md5pword2;
+ std::string encryption = passwordObject["encryption"].asString();
+ if (encryption == "none")
md5pword2 = XBMC::XBMC_MD5::GetMD5(password);
- else if (encryption.Equals("md5"))
+ else if (encryption == "md5")
md5pword2 = password;
// Verify profided password
- if (strToVerify.Equals(md5pword2))
+ if (strToVerify == md5pword2)
bLoadProfile = true;
}
*
*/
-#include "utils/StdString.h"
#include "JSONRPC.h"
#include "FileItemHandler.h"
class CProfilesOperations : CFileItemHandler
{
public:
- static JSONRPC_STATUS GetProfiles(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetCurrentProfile(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS LoadProfile(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetProfiles(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetCurrentProfile(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS LoadProfile(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
};
}
using namespace std;
using namespace JSONRPC;
-JSONRPC_STATUS CSettingsOperations::GetSections(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CSettingsOperations::GetSections(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
SettingLevel level = (SettingLevel)ParseSettingLevel(parameterObject["level"].asString());
bool listCategories = !parameterObject["properties"].empty() && parameterObject["properties"][0].asString() == "categories";
return OK;
}
-JSONRPC_STATUS CSettingsOperations::GetCategories(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CSettingsOperations::GetCategories(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
SettingLevel level = (SettingLevel)ParseSettingLevel(parameterObject["level"].asString());
std::string strSection = parameterObject["section"].asString();
return OK;
}
-JSONRPC_STATUS CSettingsOperations::GetSettings(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CSettingsOperations::GetSettings(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
SettingLevel level = (SettingLevel)ParseSettingLevel(parameterObject["level"].asString());
const CVariant &filter = parameterObject["filter"];
return OK;
}
-JSONRPC_STATUS CSettingsOperations::GetSettingValue(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CSettingsOperations::GetSettingValue(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
string settingId = parameterObject["setting"].asString();
return OK;
}
-JSONRPC_STATUS CSettingsOperations::SetSettingValue(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CSettingsOperations::SetSettingValue(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
string settingId = parameterObject["setting"].asString();
CVariant value = parameterObject["value"];
return OK;
}
-JSONRPC_STATUS CSettingsOperations::ResetSettingValue(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CSettingsOperations::ResetSettingValue(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
string settingId = parameterObject["setting"].asString();
*
*/
-#include "utils/StdString.h"
#include "JSONRPC.h"
class ISetting;
class CSettingsOperations
{
public:
- static JSONRPC_STATUS GetSections(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetCategories(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetSettings(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetSections(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetCategories(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetSettings(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetSettingValue(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS SetSettingValue(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS ResetSettingValue(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetSettingValue(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS SetSettingValue(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS ResetSettingValue(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
private:
static int ParseSettingLevel(const std::string &strLevel);
using namespace JSONRPC;
-JSONRPC_STATUS CSystemOperations::GetProperties(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CSystemOperations::GetProperties(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVariant properties = CVariant(CVariant::VariantTypeObject);
for (unsigned int index = 0; index < parameterObject["properties"].size(); index++)
{
- CStdString propertyName = parameterObject["properties"][index].asString();
+ std::string propertyName = parameterObject["properties"][index].asString();
CVariant property;
JSONRPC_STATUS ret;
if ((ret = GetPropertyValue(client->GetPermissionFlags(), propertyName, property)) != OK)
return OK;
}
-JSONRPC_STATUS CSystemOperations::EjectOpticalDrive(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CSystemOperations::EjectOpticalDrive(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
return CBuiltins::Execute("EjectTray") == 0 ? ACK : FailedToExecute;
}
-JSONRPC_STATUS CSystemOperations::Shutdown(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CSystemOperations::Shutdown(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
if (g_powerManager.CanPowerdown())
{
return FailedToExecute;
}
-JSONRPC_STATUS CSystemOperations::Suspend(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CSystemOperations::Suspend(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
if (g_powerManager.CanSuspend())
{
return FailedToExecute;
}
-JSONRPC_STATUS CSystemOperations::Hibernate(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CSystemOperations::Hibernate(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
if (g_powerManager.CanHibernate())
{
return FailedToExecute;
}
-JSONRPC_STATUS CSystemOperations::Reboot(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CSystemOperations::Reboot(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
if (g_powerManager.CanReboot())
{
return FailedToExecute;
}
-JSONRPC_STATUS CSystemOperations::GetPropertyValue(int permissions, const CStdString &property, CVariant &result)
+JSONRPC_STATUS CSystemOperations::GetPropertyValue(int permissions, const std::string &property, CVariant &result)
{
- if (property.Equals("canshutdown"))
+ if (property == "canshutdown")
result = g_powerManager.CanPowerdown() && (permissions & ControlPower);
- else if (property.Equals("cansuspend"))
+ else if (property == "cansuspend")
result = g_powerManager.CanSuspend() && (permissions & ControlPower);
- else if (property.Equals("canhibernate"))
+ else if (property == "canhibernate")
result = g_powerManager.CanHibernate() && (permissions & ControlPower);
- else if (property.Equals("canreboot"))
+ else if (property == "canreboot")
result = g_powerManager.CanReboot() && (permissions & ControlPower);
else
return InvalidParams;
*
*/
-#include "utils/StdString.h"
#include "JSONRPC.h"
namespace JSONRPC
class CSystemOperations
{
public:
- static JSONRPC_STATUS GetProperties(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetProperties(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS EjectOpticalDrive(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS EjectOpticalDrive(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Shutdown(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Suspend(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Hibernate(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Reboot(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Shutdown(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Suspend(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Hibernate(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Reboot(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
private:
- static JSONRPC_STATUS GetPropertyValue(int permissions, const CStdString &property, CVariant &result);
+ static JSONRPC_STATUS GetPropertyValue(int permissions, const std::string &property, CVariant &result);
};
}
using namespace JSONRPC;
-JSONRPC_STATUS CTextureOperations::GetTextures(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CTextureOperations::GetTextures(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CFileItemList listItems;
return OK;
}
-JSONRPC_STATUS CTextureOperations::RemoveTexture(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CTextureOperations::RemoveTexture(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int id = (int)parameterObject["textureid"].asInteger();
*
*/
-#include "utils/StdString.h"
#include "JSONRPC.h"
namespace JSONRPC
class CTextureOperations
{
public:
- static JSONRPC_STATUS GetTextures(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS RemoveTexture(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetTextures(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS RemoveTexture(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
};
}
using namespace JSONRPC;
-JSONRPC_STATUS CVideoLibrary::GetMovies(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::GetMovies(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVideoDatabase videodatabase;
if (!videodatabase.Open())
videoUrl.AddOption("tag", filter["tag"].asString());
else if (filter.isObject())
{
- CStdString xsp;
+ std::string xsp;
if (!GetXspFiltering("movies", filter, xsp))
return InvalidParams;
return GetAdditionalMovieDetails(parameterObject, items, result, videodatabase, false);
}
-JSONRPC_STATUS CVideoLibrary::GetMovieDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::GetMovieDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int id = (int)parameterObject["movieid"].asInteger();
return OK;
}
-JSONRPC_STATUS CVideoLibrary::GetMovieSets(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::GetMovieSets(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVideoDatabase videodatabase;
if (!videodatabase.Open())
return OK;
}
-JSONRPC_STATUS CVideoLibrary::GetMovieSetDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::GetMovieSetDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int id = (int)parameterObject["setid"].asInteger();
return GetAdditionalMovieDetails(parameterObject["movies"], items, result["setdetails"], videodatabase, true);
}
-JSONRPC_STATUS CVideoLibrary::GetTVShows(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::GetTVShows(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVideoDatabase videodatabase;
if (!videodatabase.Open())
videoUrl.AddOption("tag", filter["tag"].asString());
else if (filter.isObject())
{
- CStdString xsp;
+ std::string xsp;
if (!GetXspFiltering("tvshows", filter, xsp))
return InvalidParams;
bool additionalInfo = false;
for (CVariant::const_iterator_array itr = parameterObject["properties"].begin_array(); itr != parameterObject["properties"].end_array(); itr++)
{
- CStdString fieldValue = itr->asString();
+ std::string fieldValue = itr->asString();
if (fieldValue == "cast" || fieldValue == "tag")
additionalInfo = true;
}
return OK;
}
-JSONRPC_STATUS CVideoLibrary::GetTVShowDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::GetTVShowDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVideoDatabase videodatabase;
if (!videodatabase.Open())
return OK;
}
-JSONRPC_STATUS CVideoLibrary::GetSeasons(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::GetSeasons(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVideoDatabase videodatabase;
if (!videodatabase.Open())
int tvshowID = (int)parameterObject["tvshowid"].asInteger();
- CStdString strPath = StringUtils::Format("videodb://tvshows/titles/%i/", tvshowID);
+ std::string strPath = StringUtils::Format("videodb://tvshows/titles/%i/", tvshowID);
CFileItemList items;
if (!videodatabase.GetSeasonsNav(strPath, items, -1, -1, -1, -1, tvshowID, false))
return InternalError;
return OK;
}
-JSONRPC_STATUS CVideoLibrary::GetSeasonDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::GetSeasonDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVideoDatabase videodatabase;
if (!videodatabase.Open())
return OK;
}
-JSONRPC_STATUS CVideoLibrary::GetEpisodes(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::GetEpisodes(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVideoDatabase videodatabase;
if (!videodatabase.Open())
int tvshowID = (int)parameterObject["tvshowid"].asInteger();
int season = (int)parameterObject["season"].asInteger();
- CStdString strPath = StringUtils::Format("videodb://tvshows/titles/%i/%i/", tvshowID, season);
+ std::string strPath = StringUtils::Format("videodb://tvshows/titles/%i/%i/", tvshowID, season);
CVideoDbUrl videoUrl;
videoUrl.FromString(strPath);
videoUrl.AddOption("director", filter["director"].asString());
else if (filter.isObject())
{
- CStdString xsp;
+ std::string xsp;
if (!GetXspFiltering("episodes", filter, xsp))
return InvalidParams;
return GetAdditionalEpisodeDetails(parameterObject, items, result, videodatabase, false);
}
-JSONRPC_STATUS CVideoLibrary::GetEpisodeDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::GetEpisodeDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVideoDatabase videodatabase;
if (!videodatabase.Open())
if (tvshowid <= 0)
tvshowid = videodatabase.GetTvShowForEpisode(id);
- CStdString basePath = StringUtils::Format("videodb://tvshows/titles/%ld/%ld/%ld", tvshowid, infos.m_iSeason, id);
+ std::string basePath = StringUtils::Format("videodb://tvshows/titles/%ld/%ld/%ld", tvshowid, infos.m_iSeason, id);
pItem->SetPath(basePath);
HandleFileItem("episodeid", true, "episodedetails", pItem, parameterObject, parameterObject["properties"], result, false);
return OK;
}
-JSONRPC_STATUS CVideoLibrary::GetMusicVideos(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::GetMusicVideos(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVideoDatabase videodatabase;
if (!videodatabase.Open())
videoUrl.AddOption("tag", filter["tag"].asString());
else if (filter.isObject())
{
- CStdString xsp;
+ std::string xsp;
if (!GetXspFiltering("musicvideos", filter, xsp))
return InvalidParams;
return GetAdditionalMusicVideoDetails(parameterObject, items, result, videodatabase, false);
}
-JSONRPC_STATUS CVideoLibrary::GetMusicVideoDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::GetMusicVideoDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVideoDatabase videodatabase;
if (!videodatabase.Open())
return OK;
}
-JSONRPC_STATUS CVideoLibrary::GetRecentlyAddedMovies(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::GetRecentlyAddedMovies(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVideoDatabase videodatabase;
if (!videodatabase.Open())
return GetAdditionalMovieDetails(parameterObject, items, result, videodatabase, true);
}
-JSONRPC_STATUS CVideoLibrary::GetRecentlyAddedEpisodes(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::GetRecentlyAddedEpisodes(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVideoDatabase videodatabase;
if (!videodatabase.Open())
return GetAdditionalEpisodeDetails(parameterObject, items, result, videodatabase, true);
}
-JSONRPC_STATUS CVideoLibrary::GetRecentlyAddedMusicVideos(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::GetRecentlyAddedMusicVideos(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVideoDatabase videodatabase;
if (!videodatabase.Open())
return GetAdditionalMusicVideoDetails(parameterObject, items, result, videodatabase, true);
}
-JSONRPC_STATUS CVideoLibrary::GetGenres(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::GetGenres(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
- CStdString media = parameterObject["type"].asString();
+ std::string media = parameterObject["type"].asString();
StringUtils::ToLower(media);
int idContent = -1;
- CStdString strPath = "videodb://";
+ std::string strPath = "videodb://";
/* select which video content to get genres from*/
- if (media.Equals(MediaTypeMovie))
+ if (media == MediaTypeMovie)
{
idContent = VIDEODB_CONTENT_MOVIES;
strPath += "movies";
}
- else if (media.Equals(MediaTypeTvShow))
+ else if (media == MediaTypeTvShow)
{
idContent = VIDEODB_CONTENT_TVSHOWS;
strPath += "tvshows";
}
- else if (media.Equals(MediaTypeMusicVideo))
+ else if (media == MediaTypeMusicVideo)
{
idContent = VIDEODB_CONTENT_MUSICVIDEOS;
strPath += "musicvideos";
return OK;
}
-JSONRPC_STATUS CVideoLibrary::SetMovieDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::SetMovieDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int id = (int)parameterObject["movieid"].asInteger();
return ACK;
}
-JSONRPC_STATUS CVideoLibrary::SetMovieSetDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::SetMovieSetDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int id = (int)parameterObject["setid"].asInteger();
return ACK;
}
-JSONRPC_STATUS CVideoLibrary::SetTVShowDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::SetTVShowDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int id = (int)parameterObject["tvshowid"].asInteger();
return ACK;
}
-JSONRPC_STATUS CVideoLibrary::SetSeasonDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::SetSeasonDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int id = (int)parameterObject["seasonid"].asInteger();
return ACK;
}
-JSONRPC_STATUS CVideoLibrary::SetEpisodeDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::SetEpisodeDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int id = (int)parameterObject["episodeid"].asInteger();
return ACK;
}
-JSONRPC_STATUS CVideoLibrary::SetMusicVideoDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::SetMusicVideoDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int id = (int)parameterObject["musicvideoid"].asInteger();
return ACK;
}
-JSONRPC_STATUS CVideoLibrary::RemoveMovie(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::RemoveMovie(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
return RemoveVideo(parameterObject);
}
-JSONRPC_STATUS CVideoLibrary::RemoveTVShow(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::RemoveTVShow(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
return RemoveVideo(parameterObject);
}
-JSONRPC_STATUS CVideoLibrary::RemoveEpisode(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::RemoveEpisode(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
return RemoveVideo(parameterObject);
}
-JSONRPC_STATUS CVideoLibrary::RemoveMusicVideo(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::RemoveMusicVideo(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
return RemoveVideo(parameterObject);
}
-JSONRPC_STATUS CVideoLibrary::Scan(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::Scan(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
std::string directory = parameterObject["directory"].asString();
- CStdString cmd;
+ std::string cmd;
if (directory.empty())
cmd = "updatelibrary(video)";
else
return ACK;
}
-JSONRPC_STATUS CVideoLibrary::Export(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::Export(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
- CStdString cmd;
+ std::string cmd;
if (parameterObject["options"].isMember("path"))
cmd = StringUtils::Format("exportlibrary(video, false, %s)", StringUtils::Paramify(parameterObject["options"]["path"].asString()).c_str());
else
return ACK;
}
-JSONRPC_STATUS CVideoLibrary::Clean(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CVideoLibrary::Clean(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CApplicationMessenger::Get().ExecBuiltIn("cleanlibrary(video)");
return ACK;
}
-bool CVideoLibrary::FillFileItem(const CStdString &strFilename, CFileItemPtr &item, const CVariant ¶meterObject /* = CVariant(CVariant::VariantTypeArray) */)
+bool CVideoLibrary::FillFileItem(const std::string &strFilename, CFileItemPtr &item, const CVariant ¶meterObject /* = CVariant(CVariant::VariantTypeArray) */)
{
CVideoDatabase videodatabase;
if (strFilename.empty())
if (!videodatabase.Open())
return false;
- CStdString file = parameterObject["file"].asString();
+ std::string file = parameterObject["file"].asString();
int movieID = (int)parameterObject["movieid"].asInteger(-1);
int episodeID = (int)parameterObject["episodeid"].asInteger(-1);
int musicVideoID = (int)parameterObject["musicvideoid"].asInteger(-1);
bool additionalInfo = false;
for (CVariant::const_iterator_array itr = parameterObject["properties"].begin_array(); itr != parameterObject["properties"].end_array(); itr++)
{
- CStdString fieldValue = itr->asString();
+ std::string fieldValue = itr->asString();
if (fieldValue == "cast" || fieldValue == "showlink" || fieldValue == "tag" || fieldValue == "streamdetails")
additionalInfo = true;
}
bool additionalInfo = false;
for (CVariant::const_iterator_array itr = parameterObject["properties"].begin_array(); itr != parameterObject["properties"].end_array(); itr++)
{
- CStdString fieldValue = itr->asString();
+ std::string fieldValue = itr->asString();
if (fieldValue == "cast" || fieldValue == "streamdetails")
additionalInfo = true;
}
*/
#include "utils/DatabaseUtils.h"
-#include "utils/StdString.h"
#include "JSONRPC.h"
#include "FileItemHandler.h"
class CVideoLibrary : public CFileItemHandler
{
public:
- static JSONRPC_STATUS GetMovies(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetMovieDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetMovieSets(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetMovieSetDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetMovies(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetMovieDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetMovieSets(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetMovieSetDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetTVShows(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetTVShowDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetSeasons(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetSeasonDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetEpisodes(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetEpisodeDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetTVShows(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetTVShowDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetSeasons(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetSeasonDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetEpisodes(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetEpisodeDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetMusicVideos(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetMusicVideoDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetMusicVideos(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetMusicVideoDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetRecentlyAddedMovies(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetRecentlyAddedEpisodes(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetRecentlyAddedMusicVideos(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetRecentlyAddedMovies(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetRecentlyAddedEpisodes(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetRecentlyAddedMusicVideos(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetGenres(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetGenres(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS SetMovieDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS SetMovieSetDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS SetTVShowDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS SetSeasonDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS SetEpisodeDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS SetMusicVideoDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS SetMovieDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS SetMovieSetDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS SetTVShowDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS SetSeasonDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS SetEpisodeDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS SetMusicVideoDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS RemoveMovie(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS RemoveTVShow(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS RemoveEpisode(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS RemoveMusicVideo(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS RemoveMovie(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS RemoveTVShow(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS RemoveEpisode(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS RemoveMusicVideo(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Scan(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Export(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS Clean(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Scan(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Export(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS Clean(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static bool FillFileItem(const CStdString &strFilename, CFileItemPtr &item, const CVariant ¶meterObject = CVariant(CVariant::VariantTypeArray));
+ static bool FillFileItem(const std::string &strFilename, CFileItemPtr &item, const CVariant ¶meterObject = CVariant(CVariant::VariantTypeArray));
static bool FillFileItemList(const CVariant ¶meterObject, CFileItemList &list);
private:
using namespace JSONRPC;
-JSONRPC_STATUS CXBMCOperations::GetInfoLabels(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CXBMCOperations::GetInfoLabels(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
std::vector<std::string> info;
for (unsigned int i = 0; i < parameterObject["labels"].size(); i++)
{
- CStdString field = parameterObject["labels"][i].asString();
+ std::string field = parameterObject["labels"][i].asString();
StringUtils::ToLower(field);
info.push_back(parameterObject["labels"][i].asString());
return OK;
}
-JSONRPC_STATUS CXBMCOperations::GetInfoBooleans(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
+JSONRPC_STATUS CXBMCOperations::GetInfoBooleans(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
std::vector<std::string> info;
for (unsigned int i = 0; i < parameterObject["booleans"].size(); i++)
{
- CStdString field = parameterObject["booleans"][i].asString();
+ std::string field = parameterObject["booleans"][i].asString();
StringUtils::ToLower(field);
// Need to override power management of whats in infomanager since jsonrpc
// have a security layer aswell.
- if (field.Equals("system.canshutdown"))
+ if (field == "system.canshutdown")
result[parameterObject["booleans"][i].asString()] = (g_powerManager.CanPowerdown() && CanControlPower);
- else if (field.Equals("system.canpowerdown"))
+ else if (field == "system.canpowerdown")
result[parameterObject["booleans"][i].asString()] = (g_powerManager.CanPowerdown() && CanControlPower);
- else if (field.Equals("system.cansuspend"))
+ else if (field == "system.cansuspend")
result[parameterObject["booleans"][i].asString()] = (g_powerManager.CanSuspend() && CanControlPower);
- else if (field.Equals("system.canhibernate"))
+ else if (field == "system.canhibernate")
result[parameterObject["booleans"][i].asString()] = (g_powerManager.CanHibernate() && CanControlPower);
- else if (field.Equals("system.canreboot"))
+ else if (field == "system.canreboot")
result[parameterObject["booleans"][i].asString()] = (g_powerManager.CanReboot() && CanControlPower);
else
info.push_back(parameterObject["booleans"][i].asString());
*
*/
-#include "utils/StdString.h"
#include "JSONRPC.h"
namespace JSONRPC
class CXBMCOperations
{
public:
- static JSONRPC_STATUS GetInfoLabels(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
- static JSONRPC_STATUS GetInfoBooleans(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetInfoLabels(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
+ static JSONRPC_STATUS GetInfoBooleans(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
};
}
unsigned int GetMusicVideoIDs(const CStdString& strWhere, std::vector<std::pair<int,int> > &songIDs);
bool GetRandomMusicVideo(CFileItem* item, int& idSong, const CStdString& strWhere);
- static void VideoContentTypeToString(VIDEODB_CONTENT_TYPE type, CStdString& out)
+ static void VideoContentTypeToString(VIDEODB_CONTENT_TYPE type, std::string& out)
{
switch (type)
{