diff --git a/xbmc/peripherals/PeripheralTypes.h b/xbmc/peripherals/PeripheralTypes.h index e92fd411407d9..699e1b2caa1cd 100644 --- a/xbmc/peripherals/PeripheralTypes.h +++ b/xbmc/peripherals/PeripheralTypes.h @@ -19,12 +19,13 @@ * */ +#include #include +#include #include #ifdef TARGET_WINDOWS #include "PlatformDefs.h" #endif -#include "utils/StdString.h" #include "utils/StringUtils.h" class CSetting; @@ -83,9 +84,9 @@ namespace PERIPHERALS std::vector m_PeripheralID; PeripheralBusType m_busType; PeripheralType m_class; - CStdString m_strDeviceName; + std::string m_strDeviceName; PeripheralType m_mappedTo; - std::map m_settings; + std::map m_settings; }; class PeripheralTypeTranslator @@ -116,26 +117,26 @@ namespace PERIPHERALS } }; - static PeripheralType GetTypeFromString(const CStdString &strType) + static PeripheralType GetTypeFromString(const std::string &strType) { - CStdString strTypeLowerCase(strType); + std::string strTypeLowerCase(strType); StringUtils::ToLower(strTypeLowerCase); - if (strTypeLowerCase.Equals("bluetooth")) + if (strTypeLowerCase == "bluetooth") return PERIPHERAL_BLUETOOTH; - else if (strTypeLowerCase.Equals("cec")) + else if (strTypeLowerCase == "cec") return PERIPHERAL_CEC; - else if (strTypeLowerCase.Equals("disk")) + else if (strTypeLowerCase == "disk") return PERIPHERAL_DISK; - else if (strTypeLowerCase.Equals("hid")) + else if (strTypeLowerCase == "hid") return PERIPHERAL_HID; - else if (strTypeLowerCase.Equals("nic")) + else if (strTypeLowerCase == "nic") return PERIPHERAL_NIC; - else if (strTypeLowerCase.Equals("nyxboard")) + else if (strTypeLowerCase == "nyxboard") return PERIPHERAL_NYXBOARD; - else if (strTypeLowerCase.Equals("tuner")) + else if (strTypeLowerCase == "tuner") return PERIPHERAL_TUNER; - else if (strTypeLowerCase.Equals("imon")) + else if (strTypeLowerCase == "imon") return PERIPHERAL_IMON; return PERIPHERAL_UNKNOWN; @@ -158,18 +159,18 @@ namespace PERIPHERALS } }; - static PeripheralBusType GetBusTypeFromString(const CStdString &strType) + static PeripheralBusType GetBusTypeFromString(const std::string &strType) { - CStdString strTypeLowerCase(strType); + std::string strTypeLowerCase(strType); StringUtils::ToLower(strTypeLowerCase); - if (strTypeLowerCase.Equals("usb")) + if (strTypeLowerCase == "usb") return PERIPHERAL_BUS_USB; - else if (strTypeLowerCase.Equals("pci")) + else if (strTypeLowerCase == "pci") return PERIPHERAL_BUS_PCI; - else if (strTypeLowerCase.Equals("rpi")) + else if (strTypeLowerCase == "rpi") return PERIPHERAL_BUS_RPI; - else if (strTypeLowerCase.Equals("cec")) + else if (strTypeLowerCase == "cec") return PERIPHERAL_BUS_CEC; return PERIPHERAL_BUS_UNKNOWN; @@ -182,7 +183,7 @@ namespace PERIPHERALS return iVal; }; - static void FormatHexString(int iVal, CStdString &strHexString) + static void FormatHexString(int iVal, std::string &strHexString) { if (iVal < 0) iVal = 0; @@ -220,7 +221,7 @@ namespace PERIPHERALS m_iProductId == right.m_iProductId && m_type == right.m_type && m_busType == right.m_busType && - m_strLocation.Equals(right.m_strLocation); + StringUtils::EqualsNoCase(m_strLocation, right.m_strLocation); } bool operator !=(const PeripheralScanResult& right) const @@ -229,11 +230,11 @@ namespace PERIPHERALS } PeripheralType m_type; - CStdString m_strLocation; + std::string m_strLocation; int m_iVendorId; int m_iProductId; PeripheralType m_mappedType; - CStdString m_strDeviceName; + std::string m_strDeviceName; PeripheralBusType m_busType; PeripheralBusType m_mappedBusType; unsigned int m_iSequence; // when more than one adapter of the same type is found @@ -241,7 +242,7 @@ namespace PERIPHERALS struct PeripheralScanResults { - bool GetDeviceOnLocation(const CStdString& strLocation, PeripheralScanResult* result) const + bool GetDeviceOnLocation(const std::string& strLocation, PeripheralScanResult* result) const { for (std::vector::const_iterator it = m_results.begin(); it != m_results.end(); it++) { diff --git a/xbmc/peripherals/Peripherals.cpp b/xbmc/peripherals/Peripherals.cpp index 557ee351f44e1..cf5e7c1d60e5b 100644 --- a/xbmc/peripherals/Peripherals.cpp +++ b/xbmc/peripherals/Peripherals.cpp @@ -114,8 +114,8 @@ void CPeripherals::Clear(void) /* delete mappings */ for (unsigned int iMappingPtr = 0; iMappingPtr < m_mappings.size(); iMappingPtr++) { - map settings = m_mappings.at(iMappingPtr).m_settings; - for (map::iterator itr = settings.begin(); itr != settings.end(); ++itr) + map settings = m_mappings.at(iMappingPtr).m_settings; + for (map::iterator itr = settings.begin(); itr != settings.end(); ++itr) delete itr->second.m_setting; m_mappings.at(iMappingPtr).m_settings.clear(); } @@ -159,7 +159,7 @@ CPeripheralBus *CPeripherals::GetBusByType(const PeripheralBusType type) const return bus; } -CPeripheral *CPeripherals::GetPeripheralAtLocation(const CStdString &strLocation, PeripheralBusType busType /* = PERIPHERAL_BUS_UNKNOWN */) const +CPeripheral *CPeripherals::GetPeripheralAtLocation(const std::string &strLocation, PeripheralBusType busType /* = PERIPHERAL_BUS_UNKNOWN */) const { CSingleLock lock(m_critSection); CPeripheral *peripheral(NULL); @@ -177,12 +177,12 @@ CPeripheral *CPeripherals::GetPeripheralAtLocation(const CStdString &strLocation return peripheral; } -bool CPeripherals::HasPeripheralAtLocation(const CStdString &strLocation, PeripheralBusType busType /* = PERIPHERAL_BUS_UNKNOWN */) const +bool CPeripherals::HasPeripheralAtLocation(const std::string &strLocation, PeripheralBusType busType /* = PERIPHERAL_BUS_UNKNOWN */) const { return (GetPeripheralAtLocation(strLocation, busType) != NULL); } -CPeripheralBus *CPeripherals::GetBusWithDevice(const CStdString &strLocation) const +CPeripheralBus *CPeripherals::GetBusWithDevice(const std::string &strLocation) const { CSingleLock lock(m_critSection); for (unsigned int iBusPtr = 0; iBusPtr < m_busses.size(); iBusPtr++) @@ -366,7 +366,7 @@ bool CPeripherals::GetMappingForDevice(const CPeripheralBus &bus, PeripheralScan if (bProductMatch && bBusMatch && bClassMatch) { - CStdString strVendorId, strProductId; + std::string strVendorId, strProductId; PeripheralTypeTranslator::FormatHexString(result.m_iVendorId, strVendorId); PeripheralTypeTranslator::FormatHexString(result.m_iProductId, strProductId); CLog::Log(LOGDEBUG, "%s - device (%s:%s) mapped to %s (type = %s)", __FUNCTION__, strVendorId.c_str(), strProductId.c_str(), mapping.m_strDeviceName.c_str(), PeripheralTypeTranslator::TypeToString(mapping.m_mappedTo)); @@ -403,12 +403,13 @@ void CPeripherals::GetSettingsFromMapping(CPeripheral &peripheral) const if (bBusMatch && bProductMatch && bClassMatch) { - for (map::const_iterator itr = mapping->m_settings.begin(); itr != mapping->m_settings.end(); ++itr) + for (map::const_iterator itr = mapping->m_settings.begin(); itr != mapping->m_settings.end(); ++itr) peripheral.AddSetting((*itr).first, (*itr).second.m_setting, (*itr).second.m_order); } } } +#define SS(x) ((x) ? x : "") bool CPeripherals::LoadMappings(void) { CXBMCTinyXML xmlDoc; @@ -419,7 +420,7 @@ bool CPeripherals::LoadMappings(void) } TiXmlElement *pRootElement = xmlDoc.RootElement(); - if (strcmpi(pRootElement->Value(), "peripherals") != 0) + if (!pRootElement || strcmpi(pRootElement->Value(), "peripherals") != 0) { CLog::Log(LOGERROR, "%s - peripherals.xml does not contain ", __FUNCTION__); return false; @@ -464,7 +465,7 @@ bool CPeripherals::LoadMappings(void) return true; } -void CPeripherals::GetSettingsFromMappingsFile(TiXmlElement *xmlNode, map &settings) +void CPeripherals::GetSettingsFromMappingsFile(TiXmlElement *xmlNode, map &settings) { TiXmlElement *currentNode = xmlNode->FirstChildElement("setting"); int iMaxOrder = 0; @@ -472,21 +473,21 @@ void CPeripherals::GetSettingsFromMappingsFile(TiXmlElement *xmlNode, mapAttribute("label") ? atoi(currentNode->Attribute("label")) : -1; const std::string config = XMLUtils::GetAttribute(currentNode, "configurable"); bool bConfigurable = (config.empty() || (config != "no" && config != "false" && config != "0")); - if (strSettingsType.Equals("bool")) + if (strSettingsType == "bool") { const std::string value = XMLUtils::GetAttribute(currentNode, "value"); bool bValue = (value != "no" && value != "false" && value != "0"); setting = new CSettingBool(strKey, iLabelId, bValue); } - else if (strSettingsType.Equals("int")) + else if (strSettingsType == "int") { int iValue = currentNode->Attribute("value") ? atoi(currentNode->Attribute("value")) : 0; int iMin = currentNode->Attribute("min") ? atoi(currentNode->Attribute("min")) : 0; @@ -494,7 +495,7 @@ void CPeripherals::GetSettingsFromMappingsFile(TiXmlElement *xmlNode, mapAttribute("max") ? atoi(currentNode->Attribute("max")) : 255; setting = new CSettingInt(strKey, iLabelId, iValue, iMin, iStep, iMax); } - else if (strSettingsType.Equals("float")) + else if (strSettingsType == "float") { float fValue = currentNode->Attribute("value") ? (float) atof(currentNode->Attribute("value")) : 0; float fMin = currentNode->Attribute("min") ? (float) atof(currentNode->Attribute("min")) : 0; @@ -502,9 +503,9 @@ void CPeripherals::GetSettingsFromMappingsFile(TiXmlElement *xmlNode, mapAttribute("max") ? (float) atof(currentNode->Attribute("max")) : 0; setting = new CSettingNumber(strKey, iLabelId, fValue, fMin, fStep, fMax); } - else if (strSettingsType.Equals("enum")) + else if (StringUtils::EqualsNoCase(strSettingsType, "enum")) { - CStdString strEnums = XMLUtils::GetAttribute(currentNode, "lvalues"); + std::string strEnums = XMLUtils::GetAttribute(currentNode, "lvalues"); if (!strEnums.empty()) { vector< pair > enums; @@ -518,7 +519,7 @@ void CPeripherals::GetSettingsFromMappingsFile(TiXmlElement *xmlNode, map::iterator it = settings.begin(); it != settings.end(); ++it) + for (map::iterator it = settings.begin(); it != settings.end(); ++it) { if (it->second.m_order == 0) it->second.m_order = ++iMaxOrder; } } -void CPeripherals::GetDirectory(const CStdString &strPath, CFileItemList &items) const +void CPeripherals::GetDirectory(const std::string &strPath, CFileItemList &items) const { if (!StringUtils::StartsWithNoCase(strPath, "peripherals://")) return; - CStdString strPathCut = strPath.substr(14); - CStdString strBus = strPathCut.substr(0, strPathCut.find('/')); + std::string strPathCut = strPath.substr(14); + std::string strBus = strPathCut.substr(0, strPathCut.find('/')); CSingleLock lock(m_critSection); for (unsigned int iBusPtr = 0; iBusPtr < m_busses.size(); iBusPtr++) { - if (strBus.Equals("all") || strBus.Equals(PeripheralTypeTranslator::BusTypeToString(m_busses.at(iBusPtr)->Type()))) + if (StringUtils::EqualsNoCase(strBus, "all") || + StringUtils::EqualsNoCase(strBus, PeripheralTypeTranslator::BusTypeToString(m_busses.at(iBusPtr)->Type()))) m_busses.at(iBusPtr)->GetDirectory(strPath, items); } } -CPeripheral *CPeripherals::GetByPath(const CStdString &strPath) const +CPeripheral *CPeripherals::GetByPath(const std::string &strPath) const { if (!StringUtils::StartsWithNoCase(strPath, "peripherals://")) return NULL; - CStdString strPathCut = strPath.substr(14); - CStdString strBus = strPathCut.substr(0, strPathCut.find('/')); + std::string strPathCut = strPath.substr(14); + std::string strBus = strPathCut.substr(0, strPathCut.find('/')); CSingleLock lock(m_critSection); for (unsigned int iBusPtr = 0; iBusPtr < m_busses.size(); iBusPtr++) { - if (strBus.Equals(PeripheralTypeTranslator::BusTypeToString(m_busses.at(iBusPtr)->Type()))) + if (StringUtils::EqualsNoCase(strBus, PeripheralTypeTranslator::BusTypeToString(m_busses.at(iBusPtr)->Type()))) return m_busses.at(iBusPtr)->GetByPath(strPath); } diff --git a/xbmc/peripherals/Peripherals.h b/xbmc/peripherals/Peripherals.h index fcef6cad11606..c33b7a52af273 100644 --- a/xbmc/peripherals/Peripherals.h +++ b/xbmc/peripherals/Peripherals.h @@ -61,7 +61,7 @@ namespace PERIPHERALS * @param busType The bus to query. Default (PERIPHERAL_BUS_UNKNOWN) searches all busses. * @return The peripheral or NULL if it wasn't found. */ - virtual CPeripheral *GetPeripheralAtLocation(const CStdString &strLocation, PeripheralBusType busType = PERIPHERAL_BUS_UNKNOWN) const; + virtual CPeripheral *GetPeripheralAtLocation(const std::string &strLocation, PeripheralBusType busType = PERIPHERAL_BUS_UNKNOWN) const; /*! * @brief Check whether a peripheral is present at the given location. @@ -69,14 +69,14 @@ namespace PERIPHERALS * @param busType The bus to query. Default (PERIPHERAL_BUS_UNKNOWN) searches all busses. * @return True when a peripheral was found, false otherwise. */ - virtual bool HasPeripheralAtLocation(const CStdString &strLocation, PeripheralBusType busType = PERIPHERAL_BUS_UNKNOWN) const; + virtual bool HasPeripheralAtLocation(const std::string &strLocation, PeripheralBusType busType = PERIPHERAL_BUS_UNKNOWN) const; /*! * @brief Get the bus that holds the device with the given location. * @param strLocation The location. * @return The bus or NULL if no device was found. */ - virtual CPeripheralBus *GetBusWithDevice(const CStdString &strLocation) const; + virtual CPeripheralBus *GetBusWithDevice(const std::string &strLocation) const; /*! * @brief Get all peripheral instances that have the given feature. @@ -142,14 +142,14 @@ namespace PERIPHERALS * @param strPath The path to the directory to get the items from. * @param items The item list. */ - virtual void GetDirectory(const CStdString &strPath, CFileItemList &items) const; + virtual void GetDirectory(const std::string &strPath, CFileItemList &items) const; /*! * @brief Get the instance of a peripheral given it's path. * @param strPath The path to the peripheral. * @return The peripheral or NULL if it wasn't found. */ - virtual CPeripheral *GetByPath(const CStdString &strPath) const; + virtual CPeripheral *GetByPath(const std::string &strPath) const; /*! * @brief Try to let one of the peripherals handle an action. @@ -214,7 +214,7 @@ namespace PERIPHERALS CPeripherals(void); bool LoadMappings(void); bool GetMappingForDevice(const CPeripheralBus &bus, PeripheralScanResult& result) const; - static void GetSettingsFromMappingsFile(TiXmlElement *xmlNode, std::map &m_settings); + static void GetSettingsFromMappingsFile(TiXmlElement *xmlNode, std::map &m_settings); bool m_bInitialised; bool m_bIsStarted; diff --git a/xbmc/peripherals/bus/PeripheralBus.cpp b/xbmc/peripherals/bus/PeripheralBus.cpp index 7f1191b845bfc..a59c49ac2b7cd 100644 --- a/xbmc/peripherals/bus/PeripheralBus.cpp +++ b/xbmc/peripherals/bus/PeripheralBus.cpp @@ -29,8 +29,8 @@ using namespace PERIPHERALS; #define PERIPHERAL_DEFAULT_RESCAN_INTERVAL 5000 -CPeripheralBus::CPeripheralBus(const CStdString &threadname, CPeripherals *manager, PeripheralBusType type) : - CThread(threadname), +CPeripheralBus::CPeripheralBus(const std::string &threadname, CPeripherals *manager, PeripheralBusType type) : + CThread(threadname.c_str()), m_iRescanTime(PERIPHERAL_DEFAULT_RESCAN_INTERVAL), m_bInitialised(false), m_bIsStarted(false), @@ -41,17 +41,17 @@ CPeripheralBus::CPeripheralBus(const CStdString &threadname, CPeripherals *manag { } -void CPeripheralBus::OnDeviceAdded(const CStdString &strLocation) +void CPeripheralBus::OnDeviceAdded(const std::string &strLocation) { ScanForDevices(); } -void CPeripheralBus::OnDeviceChanged(const CStdString &strLocation) +void CPeripheralBus::OnDeviceChanged(const std::string &strLocation) { ScanForDevices(); } -void CPeripheralBus::OnDeviceRemoved(const CStdString &strLocation) +void CPeripheralBus::OnDeviceRemoved(const std::string &strLocation) { ScanForDevices(); } @@ -158,7 +158,7 @@ void CPeripheralBus::GetFeatures(std::vector &features) const m_peripherals.at(iPeripheralPtr)->GetFeatures(features); } -CPeripheral *CPeripheralBus::GetPeripheral(const CStdString &strLocation) const +CPeripheral *CPeripheralBus::GetPeripheral(const std::string &strLocation) const { CPeripheral *peripheral(NULL); CSingleLock lock(m_critSection); @@ -270,14 +270,14 @@ void CPeripheralBus::TriggerDeviceScan(void) } } -bool CPeripheralBus::HasPeripheral(const CStdString &strLocation) const +bool CPeripheralBus::HasPeripheral(const std::string &strLocation) const { return (GetPeripheral(strLocation) != NULL); } -void CPeripheralBus::GetDirectory(const CStdString &strPath, CFileItemList &items) const +void CPeripheralBus::GetDirectory(const std::string &strPath, CFileItemList &items) const { - CStdString strDevPath; + std::string strDevPath; CSingleLock lock(m_critSection); for (unsigned int iDevicePtr = 0; iDevicePtr < m_peripherals.size(); iDevicePtr++) { @@ -297,13 +297,13 @@ void CPeripheralBus::GetDirectory(const CStdString &strPath, CFileItemList &item } } -CPeripheral *CPeripheralBus::GetByPath(const CStdString &strPath) const +CPeripheral *CPeripheralBus::GetByPath(const std::string &strPath) const { - CStdString strDevPath; + std::string strDevPath; CSingleLock lock(m_critSection); for (unsigned int iDevicePtr = 0; iDevicePtr < m_peripherals.size(); iDevicePtr++) { - if (strPath.Equals(m_peripherals.at(iDevicePtr)->FileLocation())) + if (StringUtils::EqualsNoCase(strPath, m_peripherals.at(iDevicePtr)->FileLocation())) return m_peripherals.at(iDevicePtr); } diff --git a/xbmc/peripherals/bus/PeripheralBus.h b/xbmc/peripherals/bus/PeripheralBus.h index 795f88b6a4697..6dff42ccb1833 100644 --- a/xbmc/peripherals/bus/PeripheralBus.h +++ b/xbmc/peripherals/bus/PeripheralBus.h @@ -20,7 +20,6 @@ */ #include -#include "utils/StdString.h" #include "threads/Thread.h" #include "peripherals/PeripheralTypes.h" #include "peripherals/devices/Peripheral.h" @@ -42,7 +41,7 @@ namespace PERIPHERALS class CPeripheralBus : protected CThread { public: - CPeripheralBus(const CStdString &threadname, CPeripherals *manager, PeripheralBusType type); + CPeripheralBus(const std::string &threadname, CPeripherals *manager, PeripheralBusType type); virtual ~CPeripheralBus(void) { Clear(); } /*! @@ -60,14 +59,14 @@ namespace PERIPHERALS * @param strLocation The location. * @return The peripheral or NULL if it wasn't found. */ - virtual CPeripheral *GetPeripheral(const CStdString &strLocation) const; + virtual CPeripheral *GetPeripheral(const std::string &strLocation) const; /*! * @brief Check whether a peripheral is present at the given location. * @param strLocation The location. * @return True when a peripheral was found, false otherwise. */ - virtual bool HasPeripheral(const CStdString &strLocation) const; + virtual bool HasPeripheral(const std::string &strLocation) const; /*! * @brief Get all peripheral instances that have the given feature. @@ -97,19 +96,19 @@ namespace PERIPHERALS * @brief Callback method for when a device has been added. Will perform a device scan. * @param strLocation The location of the device that has been added. */ - virtual void OnDeviceAdded(const CStdString &strLocation); + virtual void OnDeviceAdded(const std::string &strLocation); /*! * @brief Callback method for when a device has been changed. Will perform a device scan. * @param strLocation The location of the device that has been changed. */ - virtual void OnDeviceChanged(const CStdString &strLocation); + virtual void OnDeviceChanged(const std::string &strLocation); /*! * @brief Callback method for when a device has been removed. Will perform a device scan. * @param strLocation The location of the device that has been removed. */ - virtual void OnDeviceRemoved(const CStdString &strLocation); + virtual void OnDeviceRemoved(const std::string &strLocation); /*! * @brief Initialise this bus and start a polling thread if this bus needs polling. @@ -131,14 +130,14 @@ namespace PERIPHERALS * @param strPath The path to the directory to get the items from. * @param items The item list. */ - virtual void GetDirectory(const CStdString &strPath, CFileItemList &items) const; + virtual void GetDirectory(const std::string &strPath, CFileItemList &items) const; /*! * @brief Get the instance of a peripheral given it's path. * @param strPath The path to the peripheral. * @return The peripheral or NULL if it wasn't found. */ - virtual CPeripheral *GetByPath(const CStdString &strPath) const; + virtual CPeripheral *GetByPath(const std::string &strPath) const; /*! * @brief Register a new peripheral on this bus. @@ -146,7 +145,7 @@ namespace PERIPHERALS */ virtual void Register(CPeripheral *peripheral); - virtual bool FindComPort(CStdString &strLocation) { return false; } + virtual bool FindComPort(std::string &strLocation) { return false; } virtual bool IsInitialised(void) const { return m_bInitialised; } diff --git a/xbmc/peripherals/bus/linux/PeripheralBusUSBLibUdev.cpp b/xbmc/peripherals/bus/linux/PeripheralBusUSBLibUdev.cpp index 461a4fc7f6f1b..85da3823b59ba 100644 --- a/xbmc/peripherals/bus/linux/PeripheralBusUSBLibUdev.cpp +++ b/xbmc/peripherals/bus/linux/PeripheralBusUSBLibUdev.cpp @@ -115,7 +115,7 @@ bool CPeripheralBusUSB::PerformDeviceScan(PeripheralScanResults &results) devices = udev_enumerate_get_list_entry(enumerate); bool bContinue(true); - CStdString strPath, strClass; + std::string strPath, strClass; udev_list_entry_foreach(dev_list_entry, devices) { strPath = udev_list_entry_get_name(dev_list_entry); @@ -124,7 +124,7 @@ bool CPeripheralBusUSB::PerformDeviceScan(PeripheralScanResults &results) if (bContinue) { - if (!(parent = udev_device_new_from_syspath(m_udev, strPath))) + if (!(parent = udev_device_new_from_syspath(m_udev, strPath.c_str()))) bContinue = false; } diff --git a/xbmc/peripherals/bus/osx/PeripheralBusUSB.cpp b/xbmc/peripherals/bus/osx/PeripheralBusUSB.cpp index 641ed65ef7631..1654f3cf2b113 100644 --- a/xbmc/peripherals/bus/osx/PeripheralBusUSB.cpp +++ b/xbmc/peripherals/bus/osx/PeripheralBusUSB.cpp @@ -36,7 +36,7 @@ using namespace PERIPHERALS; typedef struct USBDevicePrivateData { CPeripheralBusUSB *refCon; - CStdString deviceName; + std::string deviceName; io_object_t notification; PeripheralScanResult result; } USBDevicePrivateData; diff --git a/xbmc/peripherals/bus/win32/PeripheralBusUSB.h b/xbmc/peripherals/bus/win32/PeripheralBusUSB.h index 92c51d3a080de..3a54f925ef180 100644 --- a/xbmc/peripherals/bus/win32/PeripheralBusUSB.h +++ b/xbmc/peripherals/bus/win32/PeripheralBusUSB.h @@ -39,6 +39,6 @@ namespace PERIPHERALS private: bool PerformDeviceScan(const GUID *guid, const PeripheralType defaultType, PeripheralScanResults &results); - bool GetProductAndVendorId(const PeripheralType type, const CStdString &strDeviceLocation, int *iVendorId, int *iProductId); + bool GetProductAndVendorId(const PeripheralType type, const std::string &strDeviceLocation, int *iVendorId, int *iProductId); }; } diff --git a/xbmc/peripherals/devices/Peripheral.cpp b/xbmc/peripherals/devices/Peripheral.cpp index b1eaa1fa27b21..b1c9b76ec4c18 100644 --- a/xbmc/peripherals/devices/Peripheral.cpp +++ b/xbmc/peripherals/devices/Peripheral.cpp @@ -45,7 +45,6 @@ CPeripheral::CPeripheral(const PeripheralScanResult& scanResult) : m_mappedBusType(scanResult.m_mappedBusType), m_strLocation(scanResult.m_strLocation), m_strDeviceName(scanResult.m_strDeviceName), - m_strFileLocation(StringUtils::EmptyString), m_iVendorId(scanResult.m_iVendorId), m_iProductId(scanResult.m_iProductId), m_strVersionInfo(g_localizeStrings.Get(13205)), // "unknown" @@ -173,7 +172,7 @@ bool CPeripheral::IsMultiFunctional(void) const vector CPeripheral::GetSettings(void) const { vector tmpSettings; - for (map::const_iterator it = m_settings.begin(); it != m_settings.end(); ++it) + for (map::const_iterator it = m_settings.begin(); it != m_settings.end(); ++it) tmpSettings.push_back(it->second); sort(tmpSettings.begin(), tmpSettings.end(), SortBySettingsOrder()); @@ -183,7 +182,7 @@ vector CPeripheral::GetSettings(void) const return settings; } -void CPeripheral::AddSetting(const CStdString &strKey, const CSetting *setting, int order) +void CPeripheral::AddSetting(const std::string &strKey, const CSetting *setting, int order) { if (!setting) { @@ -250,9 +249,9 @@ void CPeripheral::AddSetting(const CStdString &strKey, const CSetting *setting, } } -bool CPeripheral::HasSetting(const CStdString &strKey) const +bool CPeripheral::HasSetting(const std::string &strKey) const { - map:: const_iterator it = m_settings.find(strKey); + map:: const_iterator it = m_settings.find(strKey); return it != m_settings.end(); } @@ -264,7 +263,7 @@ bool CPeripheral::HasSettings(void) const bool CPeripheral::HasConfigurableSettings(void) const { bool bReturn(false); - map::const_iterator it = m_settings.begin(); + map::const_iterator it = m_settings.begin(); while (it != m_settings.end() && !bReturn) { if ((*it).second.m_setting->IsVisible()) @@ -279,9 +278,9 @@ bool CPeripheral::HasConfigurableSettings(void) const return bReturn; } -bool CPeripheral::GetSettingBool(const CStdString &strKey) const +bool CPeripheral::GetSettingBool(const std::string &strKey) const { - map::const_iterator it = m_settings.find(strKey); + map::const_iterator it = m_settings.find(strKey); if (it != m_settings.end() && (*it).second.m_setting->GetType() == SettingTypeBool) { CSettingBool *boolSetting = (CSettingBool *) (*it).second.m_setting; @@ -292,9 +291,9 @@ bool CPeripheral::GetSettingBool(const CStdString &strKey) const return false; } -int CPeripheral::GetSettingInt(const CStdString &strKey) const +int CPeripheral::GetSettingInt(const std::string &strKey) const { - map::const_iterator it = m_settings.find(strKey); + map::const_iterator it = m_settings.find(strKey); if (it != m_settings.end() && (*it).second.m_setting->GetType() == SettingTypeInteger) { CSettingInt *intSetting = (CSettingInt *) (*it).second.m_setting; @@ -305,9 +304,9 @@ int CPeripheral::GetSettingInt(const CStdString &strKey) const return 0; } -float CPeripheral::GetSettingFloat(const CStdString &strKey) const +float CPeripheral::GetSettingFloat(const std::string &strKey) const { - map::const_iterator it = m_settings.find(strKey); + map::const_iterator it = m_settings.find(strKey); if (it != m_settings.end() && (*it).second.m_setting->GetType() == SettingTypeNumber) { CSettingNumber *floatSetting = (CSettingNumber *) (*it).second.m_setting; @@ -318,9 +317,9 @@ float CPeripheral::GetSettingFloat(const CStdString &strKey) const return 0; } -const CStdString CPeripheral::GetSettingString(const CStdString &strKey) const +const std::string CPeripheral::GetSettingString(const std::string &strKey) const { - map::const_iterator it = m_settings.find(strKey); + map::const_iterator it = m_settings.find(strKey); if (it != m_settings.end() && (*it).second.m_setting->GetType() == SettingTypeString) { CSettingString *stringSetting = (CSettingString *) (*it).second.m_setting; @@ -328,13 +327,13 @@ const CStdString CPeripheral::GetSettingString(const CStdString &strKey) const return stringSetting->GetValue(); } - return StringUtils::EmptyString; + return ""; } -bool CPeripheral::SetSetting(const CStdString &strKey, bool bValue) +bool CPeripheral::SetSetting(const std::string &strKey, bool bValue) { bool bChanged(false); - map::iterator it = m_settings.find(strKey); + map::iterator it = m_settings.find(strKey); if (it != m_settings.end() && (*it).second.m_setting->GetType() == SettingTypeBool) { CSettingBool *boolSetting = (CSettingBool *) (*it).second.m_setting; @@ -349,10 +348,10 @@ bool CPeripheral::SetSetting(const CStdString &strKey, bool bValue) return bChanged; } -bool CPeripheral::SetSetting(const CStdString &strKey, int iValue) +bool CPeripheral::SetSetting(const std::string &strKey, int iValue) { bool bChanged(false); - map::iterator it = m_settings.find(strKey); + map::iterator it = m_settings.find(strKey); if (it != m_settings.end() && (*it).second.m_setting->GetType() == SettingTypeInteger) { CSettingInt *intSetting = (CSettingInt *) (*it).second.m_setting; @@ -367,10 +366,10 @@ bool CPeripheral::SetSetting(const CStdString &strKey, int iValue) return bChanged; } -bool CPeripheral::SetSetting(const CStdString &strKey, float fValue) +bool CPeripheral::SetSetting(const std::string &strKey, float fValue) { bool bChanged(false); - map::iterator it = m_settings.find(strKey); + map::iterator it = m_settings.find(strKey); if (it != m_settings.end() && (*it).second.m_setting->GetType() == SettingTypeNumber) { CSettingNumber *floatSetting = (CSettingNumber *) (*it).second.m_setting; @@ -385,25 +384,25 @@ bool CPeripheral::SetSetting(const CStdString &strKey, float fValue) return bChanged; } -void CPeripheral::SetSettingVisible(const CStdString &strKey, bool bSetTo) +void CPeripheral::SetSettingVisible(const std::string &strKey, bool bSetTo) { - map::iterator it = m_settings.find(strKey); + map::iterator it = m_settings.find(strKey); if (it != m_settings.end()) (*it).second.m_setting->SetVisible(bSetTo); } -bool CPeripheral::IsSettingVisible(const CStdString &strKey) const +bool CPeripheral::IsSettingVisible(const std::string &strKey) const { - map::const_iterator it = m_settings.find(strKey); + map::const_iterator it = m_settings.find(strKey); if (it != m_settings.end()) return (*it).second.m_setting->IsVisible(); return false; } -bool CPeripheral::SetSetting(const CStdString &strKey, const CStdString &strValue) +bool CPeripheral::SetSetting(const std::string &strKey, const std::string &strValue) { bool bChanged(false); - map::iterator it = m_settings.find(strKey); + map::iterator it = m_settings.find(strKey); if (it != m_settings.end()) { if ((*it).second.m_setting->GetType() == SettingTypeString) @@ -422,7 +421,7 @@ bool CPeripheral::SetSetting(const CStdString &strKey, const CStdString &strValu else if ((*it).second.m_setting->GetType() == SettingTypeNumber) bChanged = SetSetting(strKey, (float) (strValue.empty() ? 0 : atof(strValue.c_str()))); else if ((*it).second.m_setting->GetType() == SettingTypeBool) - bChanged = SetSetting(strKey, strValue.Equals("1")); + bChanged = SetSetting(strKey, strValue == "1"); } return bChanged; } @@ -432,11 +431,11 @@ void CPeripheral::PersistSettings(bool bExiting /* = false */) CXBMCTinyXML doc; TiXmlElement node("settings"); doc.InsertEndChild(node); - for (map::const_iterator itr = m_settings.begin(); itr != m_settings.end(); ++itr) + for (map::const_iterator itr = m_settings.begin(); itr != m_settings.end(); ++itr) { TiXmlElement nodeSetting("setting"); nodeSetting.SetAttribute("id", itr->first.c_str()); - CStdString strValue; + std::string strValue; switch ((*itr).second.m_setting->GetType()) { case SettingTypeString: @@ -478,7 +477,7 @@ void CPeripheral::PersistSettings(bool bExiting /* = false */) if (!bExiting) { - for (set::const_iterator it = m_changedSettings.begin(); it != m_changedSettings.end(); ++it) + for (set::const_iterator it = m_changedSettings.begin(); it != m_changedSettings.end(); ++it) OnSettingChanged(*it); } m_changedSettings.clear(); @@ -492,8 +491,8 @@ void CPeripheral::LoadPersistedSettings(void) const TiXmlElement *setting = doc.RootElement()->FirstChildElement("setting"); while (setting) { - CStdString strId = XMLUtils::GetAttribute(setting, "id"); - CStdString strValue = XMLUtils::GetAttribute(setting, "value"); + std::string strId = XMLUtils::GetAttribute(setting, "id"); + std::string strValue = XMLUtils::GetAttribute(setting, "value"); SetSetting(strId, strValue); setting = setting->NextSiblingElement("setting"); @@ -506,7 +505,7 @@ void CPeripheral::ResetDefaultSettings(void) ClearSettings(); g_peripherals.GetSettingsFromMapping(*this); - map::iterator it = m_settings.begin(); + map::iterator it = m_settings.begin(); while (it != m_settings.end()) { m_changedSettings.insert((*it).first); @@ -518,7 +517,7 @@ void CPeripheral::ResetDefaultSettings(void) void CPeripheral::ClearSettings(void) { - map::iterator it = m_settings.begin(); + map::iterator it = m_settings.begin(); while (it != m_settings.end()) { delete (*it).second.m_setting; @@ -529,7 +528,7 @@ void CPeripheral::ClearSettings(void) bool CPeripheral::operator ==(const PeripheralScanResult& right) const { - return m_strLocation.Equals(right.m_strLocation); + return StringUtils::EqualsNoCase(m_strLocation, right.m_strLocation); } bool CPeripheral::operator !=(const PeripheralScanResult& right) const diff --git a/xbmc/peripherals/devices/Peripheral.h b/xbmc/peripherals/devices/Peripheral.h index 10a7fb33cb074..de7cac0b9efd3 100644 --- a/xbmc/peripherals/devices/Peripheral.h +++ b/xbmc/peripherals/devices/Peripheral.h @@ -20,7 +20,7 @@ */ #include -#include "utils/StdString.h" +#include #include "peripherals/PeripheralTypes.h" class TiXmlDocument; @@ -51,18 +51,18 @@ namespace PERIPHERALS bool operator ==(const PeripheralScanResult& right) const; bool operator !=(const PeripheralScanResult& right) const; - const CStdString &FileLocation(void) const { return m_strFileLocation; } - const CStdString &Location(void) const { return m_strLocation; } + const std::string &FileLocation(void) const { return m_strFileLocation; } + const std::string &Location(void) const { return m_strLocation; } int VendorId(void) const { return m_iVendorId; } const char *VendorIdAsString(void) const { return m_strVendorId.c_str(); } int ProductId(void) const { return m_iProductId; } const char *ProductIdAsString(void) const { return m_strProductId.c_str(); } const PeripheralType Type(void) const { return m_type; } const PeripheralBusType GetBusType(void) const { return m_busType; }; - const CStdString &DeviceName(void) const { return m_strDeviceName; } + const std::string &DeviceName(void) const { return m_strDeviceName; } bool IsHidden(void) const { return m_bHidden; } void SetHidden(bool bSetTo = true) { m_bHidden = bSetTo; } - const CStdString &GetVersionInfo(void) const { return m_strVersionInfo; } + const std::string &GetVersionInfo(void) const { return m_strVersionInfo; } /*! * @brief Check whether this device has the given feature. @@ -94,7 +94,7 @@ namespace PERIPHERALS * @brief Called when a setting changed. * @param strChangedSetting The changed setting. */ - virtual void OnSettingChanged(const CStdString &strChangedSetting) {}; + virtual void OnSettingChanged(const std::string &strChangedSetting) {}; /*! * @brief Called when this device is removed, before calling the destructor. @@ -117,14 +117,14 @@ namespace PERIPHERALS * @param strKey The key of the setting. * @param setting The setting. */ - virtual void AddSetting(const CStdString &strKey, const CSetting *setting, int order); + virtual void AddSetting(const std::string &strKey, const CSetting *setting, int order); /*! * @brief Check whether a setting is known with the given key. * @param strKey The key to search. * @return True when found, false otherwise. */ - virtual bool HasSetting(const CStdString &strKey) const; + virtual bool HasSetting(const std::string &strKey) const; /*! * @return True when this device has any settings, false otherwise. @@ -141,19 +141,19 @@ namespace PERIPHERALS * @param strKey The key to search. * @return The value or an empty string if it wasn't found. */ - virtual const CStdString GetSettingString(const CStdString &strKey) const; - virtual bool SetSetting(const CStdString &strKey, const CStdString &strValue); - virtual void SetSettingVisible(const CStdString &strKey, bool bSetTo); - virtual bool IsSettingVisible(const CStdString &strKey) const; + virtual const std::string GetSettingString(const std::string &strKey) const; + virtual bool SetSetting(const std::string &strKey, const std::string &strValue); + virtual void SetSettingVisible(const std::string &strKey, bool bSetTo); + virtual bool IsSettingVisible(const std::string &strKey) const; - virtual int GetSettingInt(const CStdString &strKey) const; - virtual bool SetSetting(const CStdString &strKey, int iValue); + virtual int GetSettingInt(const std::string &strKey) const; + virtual bool SetSetting(const std::string &strKey, int iValue); - virtual bool GetSettingBool(const CStdString &strKey) const; - virtual bool SetSetting(const CStdString &strKey, bool bValue); + virtual bool GetSettingBool(const std::string &strKey) const; + virtual bool SetSetting(const std::string &strKey, bool bValue); - virtual float GetSettingFloat(const CStdString &strKey) const; - virtual bool SetSetting(const CStdString &strKey, float fValue); + virtual float GetSettingFloat(const std::string &strKey) const; + virtual bool SetSetting(const std::string &strKey, float fValue); virtual void PersistSettings(bool bExiting = false); virtual void LoadPersistedSettings(void); @@ -169,21 +169,21 @@ namespace PERIPHERALS PeripheralType m_type; PeripheralBusType m_busType; PeripheralBusType m_mappedBusType; - CStdString m_strLocation; - CStdString m_strDeviceName; - CStdString m_strSettingsFile; - CStdString m_strFileLocation; + std::string m_strLocation; + std::string m_strDeviceName; + std::string m_strSettingsFile; + std::string m_strFileLocation; int m_iVendorId; - CStdString m_strVendorId; + std::string m_strVendorId; int m_iProductId; - CStdString m_strProductId; - CStdString m_strVersionInfo; + std::string m_strProductId; + std::string m_strVersionInfo; bool m_bInitialised; bool m_bHidden; bool m_bError; std::vector m_features; std::vector m_subDevices; - std::map m_settings; - std::set m_changedSettings; + std::map m_settings; + std::set m_changedSettings; }; } diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp index e80feb16bb158..7991b990a1e12 100644 --- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp +++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp @@ -269,7 +269,7 @@ bool CPeripheralCecAdapter::InitialiseFeature(const PeripheralFeature feature) CLog::Log(LOGERROR, g_localizeStrings.Get(36040).c_str(), m_cecAdapter ? m_configuration.serverVersion : -1, CEC_LIB_SUPPORTED_VERSION); // display warning: incompatible libCEC - CStdString strMessage = StringUtils::Format(g_localizeStrings.Get(36040).c_str(), m_cecAdapter ? m_configuration.serverVersion : -1, CEC_LIB_SUPPORTED_VERSION); + std::string strMessage = StringUtils::Format(g_localizeStrings.Get(36040).c_str(), m_cecAdapter ? m_configuration.serverVersion : -1, CEC_LIB_SUPPORTED_VERSION); CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Error, g_localizeStrings.Get(36000), strMessage); m_bError = true; if (m_cecAdapter) @@ -319,7 +319,7 @@ bool CPeripheralCecAdapter::OpenConnection(void) CLog::Log(LOGDEBUG, "%s - opening a connection to the CEC adapter: %s", __FUNCTION__, m_strComPort.c_str()); // scanning the CEC bus takes about 5 seconds, so display a notification to inform users that we're busy - CStdString strMessage = StringUtils::Format(g_localizeStrings.Get(21336).c_str(), g_localizeStrings.Get(36000).c_str()); + std::string strMessage = StringUtils::Format(g_localizeStrings.Get(21336).c_str(), g_localizeStrings.Get(36000).c_str()); CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Info, g_localizeStrings.Get(36000), strMessage); bool bConnectionFailedDisplayed(false); @@ -551,10 +551,10 @@ bool CPeripheralCecAdapter::IsMuted(void) void CPeripheralCecAdapter::SetMenuLanguage(const char *strLanguage) { - if (m_strMenuLanguage.Equals(strLanguage)) + if (StringUtils::EqualsNoCase(m_strMenuLanguage, strLanguage)) return; - CStdString strGuiLanguage; + std::string strGuiLanguage; if (!strcmp(strLanguage, "bul")) strGuiLanguage = "Bulgarian"; @@ -726,7 +726,7 @@ int CPeripheralCecAdapter::CecAlert(void *cbParam, const libcec_alert alert, con // display the alert if (iAlertString) { - CStdString strLog(g_localizeStrings.Get(iAlertString)); + std::string strLog(g_localizeStrings.Get(iAlertString)); if (data.paramType == CEC_PARAMETER_TYPE_STRING && data.paramData) strLog += StringUtils::Format(" - %s", (const char *)data.paramData); CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Info, g_localizeStrings.Get(36000), strLog); @@ -1109,9 +1109,9 @@ void CPeripheralCecAdapter::ResetButton(void) } } -void CPeripheralCecAdapter::OnSettingChanged(const CStdString &strChangedSetting) +void CPeripheralCecAdapter::OnSettingChanged(const std::string &strChangedSetting) { - if (strChangedSetting.Equals("enabled")) + if (StringUtils::EqualsNoCase(strChangedSetting, "enabled")) { bool bEnabled(GetSettingBool("enabled")); if (!bEnabled && IsRunning()) @@ -1233,7 +1233,7 @@ void CPeripheralCecAdapter::SetConfigurationFromLibCEC(const CEC::libcec_configu bChanged |= SetSetting("cec_hdmi_port", config.iHDMIPort); // set the physical address, when baseDevice or iHDMIPort are not set - CStdString strPhysicalAddress("0"); + std::string strPhysicalAddress("0"); if (!bPAAutoDetected && (m_configuration.baseDevice == CECDEVICE_UNKNOWN || m_configuration.iHDMIPort < CEC_MIN_HDMI_PORTNUMBER || m_configuration.iHDMIPort > CEC_MAX_HDMI_PORTNUMBER)) @@ -1308,7 +1308,7 @@ void CPeripheralCecAdapter::SetConfigurationFromSettings(void) // set the physical address // when set, it will override the connected device and hdmi port settings - CStdString strPhysicalAddress = GetSettingString("physical_address"); + std::string strPhysicalAddress = GetSettingString("physical_address"); int iPhysicalAddress; if (sscanf(strPhysicalAddress.c_str(), "%x", &iPhysicalAddress) && iPhysicalAddress >= CEC_PHYSICAL_ADDRESS_TV && @@ -1337,7 +1337,7 @@ void CPeripheralCecAdapter::SetConfigurationFromSettings(void) m_configuration.tvVendor = iVendor; // read the devices to wake when starting - CStdString strWakeDevices = GetSettingString("wake_devices_advanced"); + std::string strWakeDevices = GetSettingString("wake_devices_advanced"); StringUtils::Trim(strWakeDevices); m_configuration.wakeDevices.Clear(); if (!strWakeDevices.empty()) @@ -1346,7 +1346,7 @@ void CPeripheralCecAdapter::SetConfigurationFromSettings(void) ReadLogicalAddresses(GetSettingInt("wake_devices"), m_configuration.wakeDevices); // read the devices to power off when stopping - CStdString strStandbyDevices = GetSettingString("standby_devices_advanced"); + std::string strStandbyDevices = GetSettingString("standby_devices_advanced"); StringUtils::Trim(strStandbyDevices); m_configuration.powerOffDevices.Clear(); if (!strStandbyDevices.empty()) @@ -1375,11 +1375,11 @@ void CPeripheralCecAdapter::SetConfigurationFromSettings(void) #endif } -void CPeripheralCecAdapter::ReadLogicalAddresses(const CStdString &strString, cec_logical_addresses &addresses) +void CPeripheralCecAdapter::ReadLogicalAddresses(const std::string &strString, cec_logical_addresses &addresses) { for (size_t iPtr = 0; iPtr < strString.size(); iPtr++) { - CStdString strDevice = strString.substr(iPtr, 1); + std::string strDevice = strString.substr(iPtr, 1); StringUtils::Trim(strDevice); if (!strDevice.empty()) { @@ -1418,7 +1418,7 @@ bool CPeripheralCecAdapter::WriteLogicalAddresses(const cec_logical_addresses& a // only update the advanced setting if it was set by the user if (!GetSettingString(strAdvancedSettingName).empty()) { - CStdString strPowerOffDevices; + std::string strPowerOffDevices; for (unsigned int iPtr = CECDEVICE_TV; iPtr <= CECDEVICE_BROADCAST; iPtr++) if (addresses[iPtr]) strPowerOffDevices += StringUtils::Format(" %X", iPtr); @@ -1520,9 +1520,9 @@ void CPeripheralCecAdapterUpdateThread::UpdateMenuLanguage(void) } } -CStdString CPeripheralCecAdapterUpdateThread::UpdateAudioSystemStatus(void) +std::string CPeripheralCecAdapterUpdateThread::UpdateAudioSystemStatus(void) { - CStdString strAmpName; + std::string strAmpName; /* disable the mute setting when an amp is found, because the amp handles the mute setting and set PCM output to 100% */ @@ -1567,11 +1567,11 @@ bool CPeripheralCecAdapterUpdateThread::SetInitialConfiguration(void) UpdateMenuLanguage(); // request the OSD name of the TV - CStdString strNotification; + std::string strNotification; cec_osd_name tvName = m_adapter->m_cecAdapter->GetDeviceOSDName(CECDEVICE_TV); strNotification = StringUtils::Format("%s: %s", g_localizeStrings.Get(36016).c_str(), tvName.name); - CStdString strAmpName = UpdateAudioSystemStatus(); + std::string strAmpName = UpdateAudioSystemStatus(); if (!strAmpName.empty()) strNotification += StringUtils::Format("- %s", strAmpName.c_str()); diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.h b/xbmc/peripherals/devices/PeripheralCecAdapter.h index 0809b038fdd60..7acb255082a33 100644 --- a/xbmc/peripherals/devices/PeripheralCecAdapter.h +++ b/xbmc/peripherals/devices/PeripheralCecAdapter.h @@ -100,7 +100,7 @@ namespace PERIPHERALS bool IsMuted(void); // CPeripheral callbacks - void OnSettingChanged(const CStdString &strChangedSetting); + void OnSettingChanged(const std::string &strChangedSetting); void OnDeviceRemoved(void); // input @@ -126,7 +126,7 @@ namespace PERIPHERALS void SetConfigurationFromLibCEC(const CEC::libcec_configuration &config); void SetVersionInfo(const CEC::libcec_configuration &configuration); - static void ReadLogicalAddresses(const CStdString &strString, CEC::cec_logical_addresses &addresses); + static void ReadLogicalAddresses(const std::string &strString, CEC::cec_logical_addresses &addresses); static void ReadLogicalAddresses(int iLocalisedId, CEC::cec_logical_addresses &addresses); bool WriteLogicalAddresses(const CEC::cec_logical_addresses& addresses, const std::string& strSettingName, const std::string& strAdvancedSettingName); @@ -155,7 +155,7 @@ namespace PERIPHERALS bool m_bHasButton; bool m_bIsReady; bool m_bHasConnectedAudioSystem; - CStdString m_strMenuLanguage; + std::string m_strMenuLanguage; CDateTime m_standbySent; std::vector m_buttonQueue; CecButtonPress m_currentButton; @@ -177,7 +177,7 @@ namespace PERIPHERALS bool m_bActiveSourceBeforeStandby; bool m_bOnPlayReceived; bool m_bPlaybackPaused; - CStdString m_strComPort; + std::string m_strComPort; }; class CPeripheralCecAdapterUpdateThread : public CThread @@ -191,7 +191,7 @@ namespace PERIPHERALS protected: void UpdateMenuLanguage(void); - CStdString UpdateAudioSystemStatus(void); + std::string UpdateAudioSystemStatus(void); bool WaitReady(void); bool SetInitialConfiguration(void); void Process(void); diff --git a/xbmc/peripherals/devices/PeripheralHID.cpp b/xbmc/peripherals/devices/PeripheralHID.cpp index ed1976b48db00..6433a0d83121f 100644 --- a/xbmc/peripherals/devices/PeripheralHID.cpp +++ b/xbmc/peripherals/devices/PeripheralHID.cpp @@ -81,9 +81,9 @@ bool CPeripheralHID::InitialiseFeature(const PeripheralFeature feature) return CPeripheral::InitialiseFeature(feature); } -void CPeripheralHID::OnSettingChanged(const CStdString &strChangedSetting) +void CPeripheralHID::OnSettingChanged(const std::string &strChangedSetting) { - if (m_bInitialised && ((strChangedSetting.Equals("keymap") && !GetSettingBool("do_not_use_custom_keymap")) || strChangedSetting.Equals("keymap_enabled"))) + if (m_bInitialised && ((StringUtils::EqualsNoCase(strChangedSetting, "keymap") && !GetSettingBool("do_not_use_custom_keymap")) || StringUtils::EqualsNoCase(strChangedSetting, "keymap_enabled"))) { m_bInitialised = false; InitialiseFeature(FEATURE_HID); diff --git a/xbmc/peripherals/devices/PeripheralHID.h b/xbmc/peripherals/devices/PeripheralHID.h index bc9ea69f56388..b1e0a21e31f65 100644 --- a/xbmc/peripherals/devices/PeripheralHID.h +++ b/xbmc/peripherals/devices/PeripheralHID.h @@ -31,9 +31,9 @@ namespace PERIPHERALS virtual ~CPeripheralHID(void); virtual bool InitialiseFeature(const PeripheralFeature feature); virtual bool LookupSymAndUnicode(XBMC_keysym &keysym, uint8_t *key, char *unicode) { return false; } - virtual void OnSettingChanged(const CStdString &strChangedSetting); + virtual void OnSettingChanged(const std::string &strChangedSetting); protected: - CStdString m_strKeymap; + std::string m_strKeymap; }; } diff --git a/xbmc/peripherals/devices/PeripheralImon.cpp b/xbmc/peripherals/devices/PeripheralImon.cpp index d42d647589e70..daaaadf89f70b 100644 --- a/xbmc/peripherals/devices/PeripheralImon.cpp +++ b/xbmc/peripherals/devices/PeripheralImon.cpp @@ -75,7 +75,7 @@ bool CPeripheralImon::InitialiseFeature(const PeripheralFeature feature) return CPeripheralHID::InitialiseFeature(feature); } -void CPeripheralImon::AddSetting(const CStdString &strKey, const CSetting *setting, int order) +void CPeripheralImon::AddSetting(const std::string &strKey, const CSetting *setting, int order) { #if !defined(TARGET_WINDOWS) if (strKey.compare("disable_winjoystick")!=0) @@ -83,7 +83,7 @@ void CPeripheralImon::AddSetting(const CStdString &strKey, const CSetting *setti CPeripheralHID::AddSetting(strKey, setting, order); } -void CPeripheralImon::OnSettingChanged(const CStdString &strChangedSetting) +void CPeripheralImon::OnSettingChanged(const std::string &strChangedSetting) { if (strChangedSetting.compare("disable_winjoystick") == 0) { diff --git a/xbmc/peripherals/devices/PeripheralImon.h b/xbmc/peripherals/devices/PeripheralImon.h index d73ac8f4f57df..643e8c8b86abf 100644 --- a/xbmc/peripherals/devices/PeripheralImon.h +++ b/xbmc/peripherals/devices/PeripheralImon.h @@ -31,9 +31,9 @@ namespace PERIPHERALS CPeripheralImon(const PeripheralScanResult& scanResult); virtual ~CPeripheralImon(void) {} virtual bool InitialiseFeature(const PeripheralFeature feature); - virtual void OnSettingChanged(const CStdString &strChangedSetting); + virtual void OnSettingChanged(const std::string &strChangedSetting); virtual void OnDeviceRemoved(); - virtual void AddSetting(const CStdString &strKey, const CSetting *setting, int order); + virtual void AddSetting(const std::string &strKey, const CSetting *setting, int order); inline bool IsImonConflictsWithDInput() { return m_bImonConflictsWithDInput;} static inline long GetCountOfImonsConflictWithDInput() diff --git a/xbmc/peripherals/devices/PeripheralNyxboard.cpp b/xbmc/peripherals/devices/PeripheralNyxboard.cpp index a66bd01241b4c..777111b8b6b78 100644 --- a/xbmc/peripherals/devices/PeripheralNyxboard.cpp +++ b/xbmc/peripherals/devices/PeripheralNyxboard.cpp @@ -35,7 +35,7 @@ CPeripheralNyxboard::CPeripheralNyxboard(const PeripheralScanResult& scanResult) bool CPeripheralNyxboard::LookupSymAndUnicode(XBMC_keysym &keysym, uint8_t *key, char *unicode) { - CStdString strCommand; + std::string strCommand; if (keysym.sym == XBMCK_F7 && keysym.mod == XBMCKMOD_NONE && GetSettingBool("enable_flip_commands")) { /* switched to keyboard side */