]> git.saurik.com Git - wxWidgets.git/commitdiff
Use t_str() instead of c_str()
authorRobert Roebling <robert@roebling.de>
Fri, 4 Jul 2008 14:05:16 +0000 (14:05 +0000)
committerRobert Roebling <robert@roebling.de>
Fri, 4 Jul 2008 14:05:16 +0000 (14:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54485 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/log.cpp
src/common/msgout.cpp
src/msw/dlmsw.cpp
src/msw/registry.cpp
src/msw/snglinst.cpp
src/msw/utils.cpp

index 432ad55f1fedf800c167225ddb4a649460267164..d6041c195e3561519e43bb47a8af3f23ddc052fc 100644 (file)
@@ -183,7 +183,7 @@ IMPLEMENT_LOG_FUNCTION(Status)
 void wxSafeShowMessage(const wxString& title, const wxString& text)
 {
 #ifdef __WINDOWS__
-    ::MessageBox(NULL, text.c_str(), title.c_str(), MB_OK | MB_ICONSTOP);
+    ::MessageBox(NULL, text.t_str(), title.t_str(), MB_OK | MB_ICONSTOP);
 #else
     wxFprintf(stderr, wxS("%s: %s\n"), title.c_str(), text.c_str());
     fflush(stderr);
index 74cd4d7ba57576b9245cb411ee8653e50f6ea350..6e9c57a55833b60129bea45e0eba8f8daadcde51 100644 (file)
@@ -118,7 +118,7 @@ void wxMessageOutputBest::Output(const wxString& str)
             return;
     }
 
-    ::MessageBox(NULL, str.c_str(), NULL, MB_ICONINFORMATION | MB_OK);
+    ::MessageBox(NULL, str.t_str(), NULL, MB_ICONINFORMATION | MB_OK);
 #else // !__WINDOWS__
     // TODO: use the native message box for the other ports too
     wxMessageOutputStderr::Output(str);
@@ -159,7 +159,7 @@ void wxMessageOutputDebug::Output(const wxString& str)
     wxString out(AppendLineFeedIfNeeded(str));
     out.Replace(wxT("\t"), wxT("        "));
     out.Replace(wxT("\n"), wxT("\r\n"));
-    ::OutputDebugString(out.c_str());
+    ::OutputDebugString(out.t_str());
 #else
     // TODO: use native debug output function for the other ports too
     wxMessageOutputStderr::Output(str);
index 623f2df9b09a622363b1b0fefa3f75053eb5e50e..e517bcc3657352bd2db6fd066217d0b7d33a3068 100644 (file)
@@ -194,7 +194,7 @@ wxString wxVersionDLL::GetFileVersion(const wxString& filename) const
     wxString ver;
     if ( m_dll.IsLoaded() )
     {
-        wxChar *pc = wx_const_cast(wxChar *, (const wxChar*) filename.c_str());
+        wxChar *pc = wx_const_cast(wxChar *, (const wxChar*) filename.t_str());
 
         DWORD dummy;
         DWORD sizeVerInfo = m_pfnGetFileVersionInfoSize(pc, &dummy);
@@ -281,7 +281,7 @@ wxDllType wxDynamicLibrary::GetProgramHandle()
 wxDllType
 wxDynamicLibrary::RawLoad(const wxString& libname, int WXUNUSED(flags))
 {
-    return ::LoadLibrary(libname.c_str());
+    return ::LoadLibrary(libname.t_str());
 }
 
 /* static */
index 29c4479842133e335a3065c3329aa23cbbb16826..1def8c5dfed9ebee1c617be1471c71ff73048bdb 100644 (file)
@@ -385,7 +385,7 @@ bool wxRegKey::Open(AccessMode mode)
     m_dwLastError = ::RegOpenKeyEx
                     (
                         (HKEY) m_hRootKey,
-                        m_strKey.wc_str(),
+                        m_strKey.t_str(),
                         RESERVED,
                         mode == Read ? KEY_READ : KEY_ALL_ACCESS,
                         &tmpKey
@@ -426,7 +426,7 @@ bool wxRegKey::Create(bool bOkIfExists)
       &tmpKey,
       &disposition);
 #else
-  m_dwLastError = RegCreateKey((HKEY) m_hRootKey, m_strKey.c_str(), &tmpKey);
+  m_dwLastError = RegCreateKey((HKEY) m_hRootKey, m_strKey.t_str(), &tmpKey);
 #endif
   if ( m_dwLastError != ERROR_SUCCESS ) {
     wxLogSysError(m_dwLastError, _("Can't create registry key '%s'"),
@@ -698,7 +698,7 @@ bool wxRegKey::DeleteSelf()
   // now delete this key itself
   Close();
 
-  m_dwLastError = RegDeleteKey((HKEY) m_hRootKey, m_strKey.c_str());
+  m_dwLastError = RegDeleteKey((HKEY) m_hRootKey, m_strKey.t_str());
   // deleting a key which doesn't exist is not considered an error
   if ( m_dwLastError != ERROR_SUCCESS &&
           m_dwLastError != ERROR_FILE_NOT_FOUND ) {
@@ -942,12 +942,12 @@ bool wxRegKey::QueryValue(const wxString& szValue,
 #ifndef __WXWINCE__
                 if ( (dwType == REG_EXPAND_SZ) && !raw )
                 {
-                    DWORD dwExpSize = ::ExpandEnvironmentStrings(strValue.c_str(), NULL, 0);
+                    DWORD dwExpSize = ::ExpandEnvironmentStrings(strValue.t_str(), NULL, 0);
                     bool ok = dwExpSize != 0;
                     if ( ok )
                     {
                         wxString strExpValue;
-                        ok = ::ExpandEnvironmentStrings(strValue.c_str(),
+                        ok = ::ExpandEnvironmentStrings(strValue.t_str(),
                                                         wxStringBuffer(strExpValue, dwExpSize),
                                                         dwExpSize
                                                         ) != 0;
@@ -1408,7 +1408,7 @@ bool KeyExists(WXHKEY hRootKey, const wxString& szKey)
     if ( ::RegOpenKeyEx
          (
             (HKEY)hRootKey,
-            szKey.c_str(),
+            szKey.t_str(),
             RESERVED,
             KEY_READ,        // we might not have enough rights for rw access
             &hkeyDummy
@@ -1444,7 +1444,7 @@ inline void RemoveTrailingSeparator(wxString& str)
 
 inline const wxChar *RegValueStr(const wxString& szValue)
 {
-    return szValue.empty() ? (const wxChar*)NULL : szValue.c_str();
+    return szValue.empty() ? (const wxChar*)NULL : szValue.t_str();
 }
 
 #endif // wxUSE_REGKEY
index eb9bb3838282239ae290bcf211cbb173e66ed9a0..85b76977abfc4baed1d09835d009c829b77dd616 100644 (file)
@@ -52,7 +52,7 @@ public:
 
     bool Create(const wxString& name)
     {
-        m_hMutex = ::CreateMutex(NULL, FALSE, name.c_str());
+        m_hMutex = ::CreateMutex(NULL, FALSE, name.t_str());
         if ( !m_hMutex )
         {
             wxLogLastError(_T("CreateMutex"));
index 1bb8db7c8c1b645bda6b251afe17dd357a046832..ed2e0d224d806e218be693967aba928fb8be048b 100644 (file)
@@ -608,7 +608,7 @@ bool wxGetEnv(const wxString& WXUNUSED_IN_WINCE(var),
     return false;
 #else // Win32
     // first get the size of the buffer
-    DWORD dwRet = ::GetEnvironmentVariable(var.c_str(), NULL, 0);
+    DWORD dwRet = ::GetEnvironmentVariable(var.t_str(), NULL, 0);
     if ( !dwRet )
     {
         // this means that there is no such variable
@@ -617,7 +617,7 @@ bool wxGetEnv(const wxString& WXUNUSED_IN_WINCE(var),
 
     if ( value )
     {
-        (void)::GetEnvironmentVariable(var.c_str(),
+        (void)::GetEnvironmentVariable(var.t_str(),
                                        wxStringBuffer(*value, dwRet),
                                        dwRet);
     }
@@ -635,7 +635,7 @@ bool wxDoSetEnv(const wxString& WXUNUSED_IN_WINCE(var),
     // no environment variables under CE
     return false;
 #else
-    if ( !::SetEnvironmentVariable(var.c_str(), value) )
+    if ( !::SetEnvironmentVariable(var.t_str(), value) )
     {
         wxLogLastError(_T("SetEnvironmentVariable"));
 
@@ -648,7 +648,7 @@ bool wxDoSetEnv(const wxString& WXUNUSED_IN_WINCE(var),
 
 bool wxSetEnv(const wxString& variable, const wxString& value)
 {
-    return wxDoSetEnv(variable, value.c_str());
+    return wxDoSetEnv(variable, value.t_str());
 }
 
 bool wxUnsetEnv(const wxString& variable)