Skip to content

Commit

Permalink
[stdstring] get rid of CStdString in network/upnp/
Browse files Browse the repository at this point in the history
  • Loading branch information
notspiff authored and Montellese committed Jan 7, 2015
1 parent e54ccf4 commit fa9e057
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 58 deletions.
10 changes: 5 additions & 5 deletions xbmc/network/upnp/UPnP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class CMediaBrowser : public PLT_SyncMediaBrowser,
{
NPT_String path = "upnp://"+device->GetUUID()+"/";
if (!NPT_StringsEqual(item_id, "0")) {
CStdString id(CURL::Encode(item_id));
std::string id(CURL::Encode(item_id));
URIUtils::AddSlashAtEnd(id);
path += id.c_str();
}
Expand Down Expand Up @@ -584,7 +584,7 @@ CUPnP::CreateServer(int port /* = 0 */)
// trying to set optional upnp values for XP UPnP UI Icons to detect us
// but it doesn't work anyways as it requires multicast for XP to detect us
device->m_PresentationURL =
NPT_HttpUrl(m_IP,
NPT_HttpUrl(m_IP.c_str(),
CSettings::Get().GetInt("services.webserverport"),
"/").ToString();

Expand All @@ -608,7 +608,7 @@ CUPnP::StartServer()
if (!m_ServerHolder->m_Device.IsNull()) return false;

// load upnpserver.xml
CStdString filename = URIUtils::AddFileToFolder(CProfilesManager::Get().GetUserDataFolder(), "upnpserver.xml");
std::string filename = URIUtils::AddFileToFolder(CProfilesManager::Get().GetUserDataFolder(), "upnpserver.xml");
CUPnPSettings::Get().Load(filename);

// create the server with a XBox compatible friendlyname and UUID from upnpserver.xml if found
Expand Down Expand Up @@ -667,7 +667,7 @@ CUPnP::CreateRenderer(int port /* = 0 */)
port);

device->m_PresentationURL =
NPT_HttpUrl(m_IP,
NPT_HttpUrl(m_IP.c_str(),
CSettings::Get().GetInt("services.webserverport"),
"/").ToString();
device->m_ModelName = "Kodi";
Expand All @@ -687,7 +687,7 @@ bool CUPnP::StartRenderer()
{
if (!m_RendererHolder->m_Device.IsNull()) return false;

CStdString filename = URIUtils::AddFileToFolder(CProfilesManager::Get().GetUserDataFolder(), "upnpserver.xml");
std::string filename = URIUtils::AddFileToFolder(CProfilesManager::Get().GetUserDataFolder(), "upnpserver.xml");
CUPnPSettings::Get().Load(filename);

m_RendererHolder->m_Device = CreateRenderer(CUPnPSettings::Get().GetRendererPort());
Expand Down
4 changes: 2 additions & 2 deletions xbmc/network/upnp/UPnP.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
#pragma once

#include "utils/StdString.h"
#include <string>

class NPT_LogHandler;
class PLT_UPnP;
Expand Down Expand Up @@ -88,7 +88,7 @@ class CUPnP
PLT_MediaController* m_MediaController;

private:
CStdString m_IP;
std::string m_IP;
PLT_UPnP* m_UPnP;
NPT_LogHandler* m_LogHandler;
CDeviceHostReferenceHolder* m_ServerHolder;
Expand Down
14 changes: 7 additions & 7 deletions xbmc/network/upnp/UPnPInternal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ NPT_String
GetMimeType(const CFileItem& item,
const PLT_HttpRequestContext* context /* = NULL */)
{
CStdString path = item.GetPath();
std::string path = item.GetPath();
if (item.HasVideoInfoTag() && !item.GetVideoInfoTag()->GetPath().empty()) {
path = item.GetVideoInfoTag()->GetPath();
} else if (item.HasMusicInfoTag() && !item.GetMusicInfoTag()->GetURL().empty()) {
Expand Down Expand Up @@ -567,9 +567,9 @@ BuildObject(CFileItem& item,
// set a title for the object
if (object->m_Title.IsEmpty()) {
if (!item.GetLabel().empty()) {
CStdString title = item.GetLabel();
std::string title = item.GetLabel();
if (item.IsPlayList() || !item.m_bIsFolder) URIUtils::RemoveExtension(title);
object->m_Title = title;
object->m_Title = title.c_str();
}
}

Expand Down Expand Up @@ -616,15 +616,15 @@ BuildObject(CFileItem& item,
/*----------------------------------------------------------------------
| CUPnPServer::CorrectAllItemsSortHack
+---------------------------------------------------------------------*/
const CStdString&
CorrectAllItemsSortHack(const CStdString &item)
const std::string&
CorrectAllItemsSortHack(const std::string &item)
{
// This is required as in order for the "* All Albums" etc. items to sort
// correctly, they must have fake artist/album etc. information generated.
// This looks nasty if we attempt to render it to the GUI, thus this (further)
// workaround
if ((item.size() == 1 && item[0] == 0x01) || (item.size() > 1 && ((unsigned char) item[1]) == 0xff))
return StringUtils::EmptyString;
return StringUtils::Empty;

return item;
}
Expand Down Expand Up @@ -984,7 +984,7 @@ bool GetResource(const PLT_MediaObject* entry, CFileItem& item)
{
if(info.Match(PLT_ProtocolInfo("*", "*", allowed[type], "*")))
{
CStdString prop = StringUtils::Format("subtitle:%d", ++subs);
std::string prop = StringUtils::Format("subtitle:%d", ++subs);
item.SetProperty(prop, (const char*)res.m_Uri);
break;
}
Expand Down
4 changes: 2 additions & 2 deletions xbmc/network/upnp/UPnPInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#include <Neptune/Source/Core/NptStrings.h>

#include "system.h"
#include "utils/StdString.h"
#include "FileItem.h"
#include <string>

class CUPnPServer;
class CFileItem;
Expand Down Expand Up @@ -82,7 +82,7 @@ namespace UPNP
const NPT_String GetProtocolInfo(const CFileItem& item, const char* protocol, const PLT_HttpRequestContext* context = NULL);


const CStdString& CorrectAllItemsSortHack(const CStdString &item);
const std::string& CorrectAllItemsSortHack(const std::string &item);

NPT_Result PopulateTagFromObject(MUSIC_INFO::CMusicInfoTag& tag,
PLT_MediaObject& object,
Expand Down
1 change: 1 addition & 0 deletions xbmc/network/upnp/UPnPPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/

#include "cores/IPlayer.h"
#include <string>

class PLT_MediaController;
class CGUIDialogBusy;
Expand Down
10 changes: 5 additions & 5 deletions xbmc/network/upnp/UPnPRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ CUPnPRenderer::ProcessHttpGetRequest(NPT_HttpRequest& request,
}

// open the file
CStdString path (CURL::Decode((const char*) filepath));
std::string path (CURL::Decode((const char*) filepath));
NPT_File file(path.c_str());
NPT_Result result = file.Open(NPT_FILE_OPEN_MODE_READ);
if (NPT_FAILED(result)) {
Expand Down Expand Up @@ -277,7 +277,7 @@ CUPnPRenderer::Announce(AnnouncementFlag flag, const char *sender, const char *m
if (NPT_FAILED(FindServiceByType("urn:schemas-upnp-org:service:RenderingControl:1", rct)))
return;

CStdString buffer;
std::string buffer;

buffer = StringUtils::Format("%" PRId64, data["volume"].asInteger());
rct->SetStateVariable("Volume", buffer.c_str());
Expand Down Expand Up @@ -314,7 +314,7 @@ CUPnPRenderer::UpdateState()
avt->SetStateVariable("NumberOfTracks", "1");
avt->SetStateVariable("CurrentTrack", "1");

CStdString buffer = g_infoManager.GetCurrentPlayTime(TIME_FORMAT_HH_MM_SS);
std::string buffer = g_infoManager.GetCurrentPlayTime(TIME_FORMAT_HH_MM_SS);
avt->SetStateVariable("RelativeTimePosition", buffer.c_str());
avt->SetStateVariable("AbsoluteTimePosition", buffer.c_str());

Expand All @@ -337,7 +337,7 @@ CUPnPRenderer::UpdateState()
CGUIWindowSlideShow *slideshow = (CGUIWindowSlideShow *)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
if (slideshow)
{
CStdString index;
std::string index;
index = StringUtils::Format("%d", slideshow->NumSlides());
avt->SetStateVariable("NumberOfTracks", index.c_str());
index = StringUtils::Format("%d", slideshow->CurrentSlide());
Expand Down Expand Up @@ -403,7 +403,7 @@ CUPnPRenderer::GetMetadata(NPT_String& meta)
PLT_MediaObject* object = BuildObject(item, file_path, false, thumb_loader);
if (object) {
// fetch the item's artwork
CStdString thumb;
std::string thumb;
if (object->m_ObjectClass.type == "object.item.audioItem.musicTrack")
thumb = g_infoManager.GetImage(MUSICPLAYER_COVER, -1);
else
Expand Down
Loading

0 comments on commit fa9e057

Please sign in to comment.