made wxLocalFSHandler public and added Chroot to it

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11642 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2001-09-18 22:34:10 +00:00
parent d9d4df0e42
commit 19008b7bb8
2 changed files with 142 additions and 132 deletions

View File

@@ -138,15 +138,8 @@ wxString wxFileSystemHandler::FindNext()
// wxLocalFSHandler
//--------------------------------------------------------------------------------
class wxLocalFSHandler : public wxFileSystemHandler
{
public:
virtual bool CanOpen(const wxString& location);
virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location);
virtual wxString FindFirst(const wxString& spec, int flags = 0);
virtual wxString FindNext();
};
wxString wxLocalFSHandler::ms_root;
bool wxLocalFSHandler::CanOpen(const wxString& location)
{
@@ -156,23 +149,23 @@ bool wxLocalFSHandler::CanOpen(const wxString& location)
wxFSFile* wxLocalFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location)
{
// location has Unix path separators
wxString right = GetRightLocation(location);
wxFileName fn( right, wxPATH_UNIX );
wxString right = ms_root + GetRightLocation(location);
wxFileName fn(right, wxPATH_UNIX);
if (!wxFileExists( fn.GetFullPath() ))
if (!wxFileExists(fn.GetFullPath()))
return (wxFSFile*) NULL;
return new wxFSFile(new wxFileInputStream( fn.GetFullPath() ),
return new wxFSFile(new wxFileInputStream(fn.GetFullPath()),
right,
GetMimeTypeFromExt(location),
GetAnchor(location),
wxDateTime(wxFileModificationTime( fn.GetFullPath() )));
wxDateTime(wxFileModificationTime(fn.GetFullPath())));
}
wxString wxLocalFSHandler::FindFirst(const wxString& spec, int flags)
{
wxString right = GetRightLocation(spec);
wxString right = ms_root + GetRightLocation(spec);
return wxFindFirstFile(right, flags);
}