From 3c62105945ed63c3b7db9e3e14d942727cb056f9 Mon Sep 17 00:00:00 2001 From: Jouk Jansen Date: Fri, 23 Nov 2001 13:45:25 +0000 Subject: [PATCH] Committing in . Modified Files: wxWindows/setup.h_vms wxWindows/include/wx/filefn.h wxWindows/include/wx/filename.h wxWindows/src/common/descrip.mms wxWindows/src/common/filename.cpp Updates for OpenVMS, -Updated copmpile support for new files/features -First version of OpenVMS file support (wxPATH_VMS). (will need a lot of testing on OpenVMS systems) ---------------------------------------------------------------------- git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12621 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/filefn.h | 4 ++++ include/wx/filename.h | 1 + setup.h_vms | 4 ++++ src/common/descrip.mms | 3 +++ src/common/filename.cpp | 34 ++++++++++++++++++++++++++++++++-- 5 files changed, 44 insertions(+), 2 deletions(-) diff --git a/include/wx/filefn.h b/include/wx/filefn.h index e03a102705..a0fd19d272 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -258,6 +258,10 @@ WXDLLEXPORT bool wxRmdir(const wxString& dir, int flags = 0); #define wxFILE_SEP_PATH_DOS wxT('\\') #define wxFILE_SEP_PATH_UNIX wxT('/') #define wxFILE_SEP_PATH_MAC wxT(':') +#define wxFILE_SEP_PATH_VMS wxT('/') //This is the Unix way, but somtimes + //users will give the VMS native paths + //and than a ']' is needed. + // Jouk // separator in the path list (as in PATH environment variable) // there is no PATH variable in Classic Mac OS so just use the diff --git a/include/wx/filename.h b/include/wx/filename.h index 58ca5ecc30..cf12b36501 100644 --- a/include/wx/filename.h +++ b/include/wx/filename.h @@ -51,6 +51,7 @@ enum wxPathFormat wxPATH_UNIX, wxPATH_MAC, wxPATH_DOS, + wxPATH_VMS, wxPATH_BEOS = wxPATH_UNIX, wxPATH_WIN = wxPATH_DOS, diff --git a/setup.h_vms b/setup.h_vms index bc981e106d..10e724312f 100644 --- a/setup.h_vms +++ b/setup.h_vms @@ -497,6 +497,10 @@ * Use wxFile class */ #define wxUSE_FILE 1 +/* + * Use wxTextBuffer class + */ +#define wxUSE_TEXTBUFFER 1 /* * Use wxTextFile class */ diff --git a/src/common/descrip.mms b/src/common/descrip.mms index d7a7cd9a1c..ca8a36bf51 100644 --- a/src/common/descrip.mms +++ b/src/common/descrip.mms @@ -128,6 +128,7 @@ OBJECTS1=framecmn.obj,\ string.obj,\ sysopt.obj,\ tbarbase.obj,\ + textbuf.obj,\ textcmn.obj,\ textfile.obj,\ timercmn.obj,\ @@ -241,6 +242,7 @@ SOURCES = \ sysopt.cpp,\ string.cpp,\ tbarbase.cpp,\ + textbuf.cpp,\ textcmn.cpp,\ textfile.cpp,\ timercmn.cpp,\ @@ -386,6 +388,7 @@ stream.obj : stream.cpp sysopt.obj : sysopt.cpp string.obj : string.cpp tbarbase.obj : tbarbase.cpp +textbuf.obj : textbuf.cpp textcmn.obj : textcmn.cpp textfile.obj : textfile.cpp timercmn.obj : timercmn.cpp diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 38f20fee49..57907ce9e2 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -497,8 +497,9 @@ bool wxFileName::SameAs( const wxFileName &filepath, wxPathFormat format) /* static */ bool wxFileName::IsCaseSensitive( wxPathFormat format ) { - // only DOS filenames are case-sensitive - return GetFormat(format) != wxPATH_DOS; + // only DOS and OpenVMS filenames are case-sensitive + return ( GetFormat(format) != wxPATH_DOS & + GetFormat(format) != wxPATH_VMS ); } bool wxFileName::IsRelative( wxPathFormat format ) @@ -544,6 +545,10 @@ wxString wxFileName::GetPathSeparators(wxPathFormat format) case wxPATH_MAC: seps = wxFILE_SEP_PATH_MAC; break; + + case wxPATH_VMS: + seps = wxFILE_SEP_PATH_VMS; + break; } return seps; @@ -646,6 +651,17 @@ wxString wxFileName::GetFullPath( wxPathFormat format ) const } } else + if (format == wxPATH_VMS) + { + ret += '['; + for (size_t i = 0; i < m_dirs.GetCount(); i++) + { + ret += '.'; + ret += m_dirs[i]; + } + ret += ']'; + } + else { for (size_t i = 0; i < m_dirs.GetCount(); i++) { @@ -813,6 +829,8 @@ wxPathFormat wxFileName::GetFormat( wxPathFormat format ) format = wxPATH_DOS; #elif defined(__WXMAC__) && !defined(__DARWIN__) format = wxPATH_MAC; +#elif defined(__VMS) + format = wxPATH_VMS; #else format = wxPATH_UNIX; #endif @@ -847,6 +865,18 @@ void wxFileName::SplitPath(const wxString& fullpath, posLastDot = wxString::npos; } } + else + if ( (posLastDot != wxString::npos) && (format == wxPATH_VMS) ) + { + if ( (posLastDot == 0) || + (fullpath[posLastDot - 1] == ']' ) ) + { + // under OpenVMS, dot may be (and commonly is) the first character of + // the filename, don't treat the entire filename as extension in + // this case + posLastDot = wxString::npos; + } + } // if we do have a dot and a slash, check that the dot is in the name part if ( (posLastDot != wxString::npos) && -- 2.45.2