LibCecSharp: fixed - set the primary LA in CecLogicalAddresses
[deb_libcec.git] / src / lib / platform / sockets / socket.h
index f56d515c5e76676f95573555db07ad41523fe887..e894172b0873f7eb52029c325ccf77109018fad1 100644 (file)
  *     http://www.pulse-eight.net/
  */
 
-#include "../threads/mutex.h"
-#include "../util/StdString.h"
+#include "lib/platform/threads/mutex.h"
 
 #if defined(__WINDOWS__)
-#include "../windows/os-socket.h"
+#include "lib/platform/windows/os-socket.h"
 #else
-#include "../posix/os-socket.h"
+#include "lib/platform/posix/os-socket.h"
 #endif
 
+#include <string>
+
 // Common socket operations
 
 namespace PLATFORM
@@ -56,26 +57,26 @@ namespace PLATFORM
     virtual bool IsOpen(void) = 0;
     virtual ssize_t Write(void* data, size_t len) = 0;
     virtual ssize_t Read(void* data, size_t len, uint64_t iTimeoutMs = 0) = 0;
-    virtual CStdString GetError(void) = 0;
+    virtual std::string GetError(void) = 0;
     virtual int GetErrorNumber(void) = 0;
-    virtual CStdString GetName(void) = 0;
+    virtual std::string GetName(void) = 0;
   };
 
   template <typename _SType>
   class CCommonSocket : public ISocket
   {
   public:
-    CCommonSocket(_SType initialSocketValue, const CStdString &strName) :
+    CCommonSocket(_SType initialSocketValue, const std::string &strName) :
       m_socket(initialSocketValue),
       m_strName(strName),
       m_iError(0) {}
 
     virtual ~CCommonSocket(void) {}
 
-    virtual CStdString GetError(void)
+    virtual std::string GetError(void)
     {
-      CStdString strError;
-      strError = m_strError.IsEmpty() && m_iError != 0 ? strerror(m_iError) : m_strError;
+      std::string strError;
+      strError = m_strError.empty() && m_iError != 0 ? strerror(m_iError) : m_strError;
       return strError;
     }
 
@@ -84,17 +85,17 @@ namespace PLATFORM
       return m_iError;
     }
 
-    virtual CStdString GetName(void)
+    virtual std::string GetName(void)
     {
-      CStdString strName;
+      std::string strName;
       strName = m_strName;
       return strName;
     }
 
   protected:
     _SType     m_socket;
-    CStdString m_strError;
-    CStdString m_strName;
+    std::string m_strError;
+    std::string m_strName;
     int        m_iError;
     CMutex     m_mutex;
   };
@@ -182,9 +183,9 @@ namespace PLATFORM
       return iReturn;
     }
 
-    virtual CStdString GetError(void)
+    virtual std::string GetError(void)
     {
-      CStdString strError;
+      std::string strError;
       CLockObject lock(m_mutex);
       strError = m_socket ? m_socket->GetError() : "";
       return strError;
@@ -196,9 +197,9 @@ namespace PLATFORM
       return m_socket ? m_socket->GetErrorNumber() : -EINVAL;
     }
 
-    virtual CStdString GetName(void)
+    virtual std::string GetName(void)
     {
-      CStdString strName;
+      std::string strName;
       CLockObject lock(m_mutex);
       strName = m_socket ? m_socket->GetName() : "";
       return strName;