X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6cb5e50b0d2259de305f273d2be3d28d7e84dc6a..b4626104e5a68430c5c7c4f3a0b79425be9945e8:/include/wx/stdpaths.h?ds=sidebyside diff --git a/include/wx/stdpaths.h b/include/wx/stdpaths.h index c69f4435f6..c4b3cb2b7b 100644 --- a/include/wx/stdpaths.h +++ b/include/wx/stdpaths.h @@ -12,9 +12,11 @@ #ifndef _WX_STDPATHS_H_ #define _WX_STDPATHS_H_ -#include "wx/string.h" +#include "wx/defs.h" + +#if wxUSE_STDPATHS -class WXDLLIMPEXP_BASE wxStandardPaths; +#include "wx/string.h" // ---------------------------------------------------------------------------- // wxStandardPaths returns the standard locations in the file system @@ -24,7 +26,7 @@ class WXDLLIMPEXP_BASE wxStandardPathsBase { public: // return the global standard paths object - static wxStandardPaths& Get(); + static wxStandardPathsBase& Get(); // return the directory with system config files: @@ -75,15 +77,49 @@ public: // virtual dtor for the base class virtual ~wxStandardPathsBase(); + +protected: + // append "/appname" suffix if the app name is set (doesn't append the + // slash if dir already ends with a slash or dot) + static wxString AppendAppName(const wxString& dir); }; #if defined(__WXMSW__) #include "wx/msw/stdpaths.h" -#elif defined(__WXMAC_OSX__) || defined(__WXCOCOA__) - #include "wx/mac/stdpaths.h" +// We want CoreFoundation paths on both CarbonLib and Darwin (for all ports) +#elif defined(__WXMAC__) || defined(__DARWIN__) + #include "wx/mac/corefoundation/stdpaths.h" +#elif defined(__OS2__) + #include "wx/os2/stdpaths.h" #elif defined(__UNIX__) #include "wx/unix/stdpaths.h" +#elif defined(__PALMOS__) + #include "wx/palmos/stdpaths.h" +#else + +// ---------------------------------------------------------------------------- +// Minimal generic implementation +// ---------------------------------------------------------------------------- + +class WXDLLIMPEXP_BASE wxStandardPaths : public wxStandardPathsBase +{ +public: + void SetInstallPrefix(const wxString& prefix) { m_prefix = prefix; } + wxString GetInstallPrefix() const { return m_prefix; } + virtual wxString GetConfigDir() const { return m_prefix; } + virtual wxString GetUserConfigDir() const { return m_prefix; } + virtual wxString GetDataDir() const { return m_prefix; } + virtual wxString GetLocalDataDir() const { return m_prefix; } + virtual wxString GetUserDataDir() const { return m_prefix; } + virtual wxString GetPluginsDir() const { return m_prefix; } + +private: + wxString m_prefix; +}; + #endif +#endif // wxUSE_STDPATHS + #endif // _WX_STDPATHS_H_