projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
subclass all updown controls in notebooks, not just the first one
[wxWidgets.git]
/
include
/
wx
/
filesys.h
diff --git
a/include/wx/filesys.h
b/include/wx/filesys.h
index b8e5da09272c68247e2c346d99e2c7e10624e7ca..99dba2e96c2de6527b71b6d4df14e207a9203792 100644
(file)
--- a/
include/wx/filesys.h
+++ b/
include/wx/filesys.h
@@
-4,17
+4,17
@@
// Author: Vaclav Slavik
// Copyright: (c) 1999 Vaclav Slavik
// RCS-ID: $Id$
// Author: Vaclav Slavik
// Copyright: (c) 1999 Vaclav Slavik
// RCS-ID: $Id$
-// Licence: wxWindows
L
icence
+// Licence: wxWindows
l
icence
/////////////////////////////////////////////////////////////////////////////
#ifndef __FILESYS_H__
#define __FILESYS_H__
/////////////////////////////////////////////////////////////////////////////
#ifndef __FILESYS_H__
#define __FILESYS_H__
-#if defined(__GNUG__) && !defined(
__APPLE__
)
+#if defined(__GNUG__) && !defined(
NO_GCC_PRAGMA
)
#pragma interface "filesys.h"
#endif
#pragma interface "filesys.h"
#endif
-#include "wx/
setup
.h"
+#include "wx/
defs
.h"
#if !wxUSE_STREAMS
#error You cannot compile virtual file systems without wxUSE_STREAMS
#if !wxUSE_STREAMS
#error You cannot compile virtual file systems without wxUSE_STREAMS
@@
-27,12
+27,12
@@
#if wxUSE_FILESYSTEM
#include "wx/stream.h"
#if wxUSE_FILESYSTEM
#include "wx/stream.h"
-#include "wx/url.h"
#include "wx/datetime.h"
#include "wx/datetime.h"
+#include "wx/filename.h"
-class wxFSFile;
-class wxFileSystemHandler;
-class wxFileSystem;
+class
WXDLLIMPEXP_BASE
wxFSFile;
+class
WXDLLIMPEXP_BASE
wxFileSystemHandler;
+class
WXDLLIMPEXP_BASE
wxFileSystem;
//--------------------------------------------------------------------------------
// wxFSFile
//--------------------------------------------------------------------------------
// wxFSFile
@@
-41,23
+41,29
@@
class wxFileSystem;
// (in 'index.htm#chapter2', 'chapter2' is anchor)
//--------------------------------------------------------------------------------
// (in 'index.htm#chapter2', 'chapter2' is anchor)
//--------------------------------------------------------------------------------
-class WXDLL
EXPORT
wxFSFile : public wxObject
+class WXDLL
IMPEXP_BASE
wxFSFile : public wxObject
{
public:
wxFSFile(wxInputStream *stream, const wxString& loc,
{
public:
wxFSFile(wxInputStream *stream, const wxString& loc,
- const wxString& mimetype, const wxString& anchor,
- wxDateTime modif)
+ const wxString& mimetype, const wxString& anchor
+#if wxUSE_DATETIME
+ , wxDateTime modif
+#endif // wxUSE_DATETIME
+ )
{
m_Stream = stream;
m_Location = loc;
m_MimeType = mimetype; m_MimeType.MakeLower();
m_Anchor = anchor;
{
m_Stream = stream;
m_Location = loc;
m_MimeType = mimetype; m_MimeType.MakeLower();
m_Anchor = anchor;
+#if wxUSE_DATETIME
m_Modif = modif;
m_Modif = modif;
+#endif // wxUSE_DATETIME
}
}
+
virtual ~wxFSFile() { if (m_Stream) delete m_Stream; }
// returns stream. This doesn't _create_ stream, it only returns
virtual ~wxFSFile() { if (m_Stream) delete m_Stream; }
// returns stream. This doesn't _create_ stream, it only returns
- // pointer to it
!!
+ // pointer to it
.
wxInputStream *GetStream() const {return m_Stream;}
// returns file's mime type
wxInputStream *GetStream() const {return m_Stream;}
// returns file's mime type
@@
-68,16
+74,21
@@
public:
const wxString& GetAnchor() const {return m_Anchor;}
const wxString& GetAnchor() const {return m_Anchor;}
+#if wxUSE_DATETIME
wxDateTime GetModificationTime() const {return m_Modif;}
wxDateTime GetModificationTime() const {return m_Modif;}
+#endif // wxUSE_DATETIME
private:
wxInputStream *m_Stream;
wxString m_Location;
wxString m_MimeType;
wxString m_Anchor;
private:
wxInputStream *m_Stream;
wxString m_Location;
wxString m_MimeType;
wxString m_Anchor;
+#if wxUSE_DATETIME
wxDateTime m_Modif;
wxDateTime m_Modif;
+#endif // wxUSE_DATETIME
DECLARE_ABSTRACT_CLASS(wxFSFile)
DECLARE_ABSTRACT_CLASS(wxFSFile)
+ DECLARE_NO_COPY_CLASS(wxFSFile)
};
};
@@
-91,12
+102,12
@@
private:
// kinds of files (HTPP, FTP, local, tar.gz etc..)
//--------------------------------------------------------------------------------
// kinds of files (HTPP, FTP, local, tar.gz etc..)
//--------------------------------------------------------------------------------
-class WXDLL
EXPORT
wxFileSystemHandler : public wxObject
+class WXDLL
IMPEXP_BASE
wxFileSystemHandler : public wxObject
{
public:
wxFileSystemHandler() : wxObject() {}
{
public:
wxFileSystemHandler() : wxObject() {}
- // returns
TRUE
if this handler is able to open given location
+ // returns
true
if this handler is able to open given location
virtual bool CanOpen(const wxString& location) = 0;
// opens given file and returns pointer to input stream.
virtual bool CanOpen(const wxString& location) = 0;
// opens given file and returns pointer to input stream.
@@
-145,18
+156,19
@@
protected:
// kinds of files (HTPP, FTP, local, tar.gz etc..)
//--------------------------------------------------------------------------------
// kinds of files (HTPP, FTP, local, tar.gz etc..)
//--------------------------------------------------------------------------------
-class WXDLL
EXPORT
wxFileSystem : public wxObject
+class WXDLL
IMPEXP_BASE
wxFileSystem : public wxObject
{
public:
{
public:
- wxFileSystem() : wxObject() {m_Path = m_LastName = wxEmptyString; m_Handlers.DeleteContents(TRUE); m_FindFileHandler = NULL;}
+ wxFileSystem() : wxObject() { m_FindFileHandler = NULL;}
+ virtual ~wxFileSystem() { }
// sets the current location. Every call to OpenFile is
// relative to this location.
// NOTE !!
// sets the current location. Every call to OpenFile is
// relative to this location.
// NOTE !!
- // unless is_dir =
TRUE
'location' is *not* the directory but
+ // unless is_dir =
true
'location' is *not* the directory but
// file contained in this directory
// (so ChangePathTo("dir/subdir/xh.htm") sets m_Path to "dir/subdir/")
// file contained in this directory
// (so ChangePathTo("dir/subdir/xh.htm") sets m_Path to "dir/subdir/")
- void ChangePathTo(const wxString& location, bool is_dir =
FALSE
);
+ void ChangePathTo(const wxString& location, bool is_dir =
false
);
wxString GetPath() const {return m_Path;}
wxString GetPath() const {return m_Path;}
@@
-174,12
+186,19
@@
public:
wxString FindNext();
// Adds FS handler.
wxString FindNext();
// Adds FS handler.
- // In fact, this class is only front-end to the FS hanlers :-)
+ // In fact, this class is only front-end to the FS han
d
lers :-)
static void AddHandler(wxFileSystemHandler *handler);
// remove all items from the m_Handlers list
static void CleanUpHandlers();
static void AddHandler(wxFileSystemHandler *handler);
// remove all items from the m_Handlers list
static void CleanUpHandlers();
+ // Returns the native path for a file URL
+ static wxFileName URLToFileName(const wxString& url);
+
+ // Returns the file URL for a native path
+ static wxString FileNameToURL(const wxFileName& filename);
+
+
protected:
wxString m_Path;
// the path (location) we are currently in
protected:
wxString m_Path;
// the path (location) we are currently in
@@
-194,6
+213,7
@@
protected:
// handler that succeed in FindFirst query
DECLARE_DYNAMIC_CLASS(wxFileSystem)
// handler that succeed in FindFirst query
DECLARE_DYNAMIC_CLASS(wxFileSystem)
+ DECLARE_NO_COPY_CLASS(wxFileSystem)
};
};
@@
-221,7
+241,7
@@
special characters :
*/
*/
-class wxLocalFSHandler : public wxFileSystemHandler
+class
WXDLLIMPEXP_BASE
wxLocalFSHandler : public wxFileSystemHandler
{
public:
virtual bool CanOpen(const wxString& location);
{
public:
virtual bool CanOpen(const wxString& location);