- public:
- wxFileSystemHandler() : wxObject() {}
-
- virtual bool CanOpen(const wxString& location) = 0;
- // returns TRUE if this handler is able to open given location
-
- virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location) = 0;
- // opens given file and returns pointer to input stream.
- // Returns NULL if opening failed.
- // The location is always absolute path.
-
- virtual wxString FindFirst(const wxString& spec, int flags = 0);
- virtual wxString FindNext();
- // Finds first/next file that matches spec wildcard. flags can be wxDIR for restricting
- // the query to directories or wxFILE for files only or 0 for either.
- // Returns filename or empty string if no more matching file exists
-
- protected:
- wxString GetProtocol(const wxString& location) const;
- // returns protocol ("file", "http", "tar" etc.) The last (most right)
- // protocol is used:
- // {it returns "tar" for "file:subdir/archive.tar.gz#tar:/README.txt"}
-
- wxString GetLeftLocation(const wxString& location) const;
- // returns left part of address:
- // {it returns "file:subdir/archive.tar.gz" for "file:subdir/archive.tar.gz#tar:/README.txt"}
-
- wxString GetAnchor(const wxString& location) const;
- // returns anchor part of address:
- // {it returns "anchor" for "file:subdir/archive.tar.gz#tar:/README.txt#anchor"}
- // NOTE: anchor is NOT a part of GetLeftLocation()'s return value
-
- wxString GetRightLocation(const wxString& location) const;
- // returns right part of address:
- // {it returns "/README.txt" for "file:subdir/archive.tar.gz#tar:/README.txt"}
-
- wxString GetMimeTypeFromExt(const wxString& location);
- // Returns MIME type of the file - w/o need to open it
- // (default behaviour is that it returns type based on extension)
-
- public:
- static void CleanUpStatics();
- // deletes static members (m_MimeMng). It can be called
- // as many times as you wish because m_MimeMng is created
- // on demand
-
- private:
- static wxMimeTypesManager *m_MimeMng;
- // MIME manager
- // (it's static and thus shared by all instances and derived classes)