]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filefn.cpp
wxScrolledWindow inherits from wxPanel to
[wxWidgets.git] / src / common / filefn.cpp
index fd63c60c7e634d1a9820a66f2e4bdaefbe0980fc..51d2877c20e299c75a858ce6bf62c58ae31dd66c 100644 (file)
@@ -277,7 +277,7 @@ bool wxFileExists(const char *pszFileName)
 bool
 wxIsAbsolutePath (const wxString& filename)
 {
-  if (filename != "")
+  if (filename != _T(""))
     {
       if (filename[0] == _T('/')
 #ifdef __VMS__
@@ -514,7 +514,8 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
         /* prefix ~ */
         if (nm[1] == SEP || nm[1] == 0)
         {        /* ~/filename */
-            if ((s = wxGetUserHome(_T(""))) != NULL) {
+           // FIXME: wxGetUserHome could return temporary storage in Unicode mode
+            if ((s = WXSTRINGCAST wxGetUserHome(_T(""))) != NULL) {
                 if (*++nm)
                     nm++;
             }
@@ -527,7 +528,8 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
             was_sep = (*s == SEP);
             nnm = *s ? s + 1 : s;
             *s = 0;
-            if ((home = wxGetUserHome(wxString(nm + 1))) == NULL) {
+           // FIXME: wxGetUserHome could return temporary storage in Unicode mode
+            if ((home = WXSTRINGCAST wxGetUserHome(wxString(nm + 1))) == NULL) {
                if (was_sep) /* replace only if it was there: */
                    *s = SEP;
                 s = _T("");
@@ -577,7 +579,7 @@ wxContractPath (const wxString& filename, const wxString& envname, const wxStrin
 #endif
 
   // Handle environment
-  wxChar *val = (wxChar *) NULL;
+  const wxChar *val = (const wxChar *) NULL;
   wxChar *tcp = (wxChar *) NULL;
   if (envname != WXSTRINGCAST NULL && (val = wxGetenv (WXSTRINGCAST envname)) != NULL &&
      (tcp = wxStrstr (dest, val)) != NULL)
@@ -719,7 +721,7 @@ wxPathOnly (wxChar *path)
 // Return just the directory, or NULL if no directory
 wxString wxPathOnly (const wxString& path)
 {
-  if (path != "")
+  if (path != _T(""))
     {
       wxChar buf[_MAXPATHLEN];
 
@@ -1508,9 +1510,9 @@ wxString wxGetOSDirectory()
 #endif
 }
 
-bool wxEndsWithPathSeparator(const char *pszFileName)
+bool wxEndsWithPathSeparator(const wxChar *pszFileName)
 {
-  size_t len = Strlen(pszFileName);
+  size_t len = wxStrlen(pszFileName);
   if ( len == 0 )
     return FALSE;
   else